簡體   English   中英

mongorestore過濾器ISODate給出錯誤

[英]mongorestore filter ISODate gives error

我有這個查詢

mongorestore  --db xxx --collection categories  --filter '{"creation_date": {"$gt": ISODate("2015-06-06T20:00:00Z")}}' /backups/xxx/dump/xxx/xxx.bson

並有這個錯誤

assertion: 16619 code FailedToParse: FailedToParse: Bad characters in value: offset:25 of:{"creation_date": {"$gt": ISODate("2015-06-06T20:00:00Z")}}

我認為mongorestore對ISODate不滿意,有什么想法嗎?

將版本用於嚴格模式

我遇到了同樣的問題,然后我發現了這個GitHub問題 ,指出了這個JIRA問題 ,指出我們可以使用{"$date": "2015-06-06T20:00:00Z"}代替ISODate("2015-06-06T20:00:00Z")因此您的查詢應如下所示:

mongorestore --db xxx --collection categories --filter '{"creation_date": {"$gt": {"$date": "2015-06-06T20:00:00Z"}}}' /backups/xxx/dump/xxx/xxx.bson

MongoDB擴展JSON中記錄了此功能。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM