【发布时间】:2016-07-19 11:41:09
【问题描述】:
我的情况有点奇怪。
我将对象保存在集合“refs”中,明确设置_id。 所以我有非常大 id 的对象。
db.refs.find().sort({_id: -1});
// {_id: 9200000000165761625}
// ...
但是当我尝试在 mongo shell 中查找具有最大 id 的对象时,它什么也不返回:
db.refs.find({_id: 9200000000165761625}); // nothing
但是!
db.refs.find({_id: 9200000000165761625}).count(); // return 1
怎么会这样?
【问题讨论】:
-
db.refs.count({_id: 9200000000165761625}) 怎么样
-
我在尝试使用 twitter ID 作为我的 _id 时遇到了同样的问题。将 python 加载器代码更改为使用 str(tweet.id)。
标签: mongodb mongodb-query mongo-shell