How can I use mongodump to dump out records matching a specific date range?

后端 未结 8 424
悲哀的现实
悲哀的现实 2021-01-30 10:45

I\'m trying to use the mongodump command to dump out a bunch of records created on a specific date. The records include a \"ts\" field which is a MongoDB Date() object.

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 10:57

    use single quotes around the query. I found that ISODate() doesn't work.

    mongodump --query  '{"ts":{$gt:{$date:178929000}}}'
    

提交回复
热议问题