-1
コマンドラインからrepo_date値をクエリに挿入する必要があります。以下を試してみましたが、クエリに値を挿入できません。grrovyで一重引用符で囲まれた文字列内でコマンドライン値を取得
String repo = this.args[0]
String repo_date = this.args[1] + "T00:00:00.000Z"
def query='items.find({"type" : "file","repo" :{"$match" : "${repo}"},"created":{"$lt": "${repo_date}").include("name","created").sort({"$asc": ["created"]})'
エスケープ文字を使用しようとしました。
など私はあなたがクエリ内全体クエリ文字列の周りトリプル二重引用符は、二重引用符を使用している場合ではないでしょう
def query='items.find({"type" : "file","repo" :{"$match" : "xyz"},"created":{"$lt": "2010-10-10T00:00:00.000Z").include("name","created").sort({"$asc": ["created"]})'
Thanks @ Emmanuel Rosaそれは今働いている。 – user6136315