我正在尝试使用查询进行 mongodump。下面是我的语法。
mongodump --db mydatabase --collection records --query '{ "embedded_document.field_1" : { "$ne" : "Zebra" }}' -vvvv
我想要做的是转储所有embedded_document.field_1
不等于的记录Zebra
。
我有 100 条记录Zebra
,但找到的记录数等于所有记录数 ( 5000
)。
Collection File Writing Progress: 200/5000 0% (objects)
该查询在 mongo shell 中运行,它返回正确的计数 ( 100
)。
db.records.find({ "embedded_document.field_1" : { "$ne" : "Zebra" }}).count();
有任何想法吗?