我采集了一个行政区划的数据,使用如下命令查询省一级的数据db.collection.find({'_id':{$mod: [10000000000,0]}})
没有任何返回数据
正常需要返回如下数据
{ "_id" : NumberLong("110000000000"), "name" : "北京市" }, /* 2 */ { "_id" : NumberLong("120000000000"), "name" : "天津市" }, /* 3 */ { "_id" : NumberLong("130000000000"), "name" : "河北省" }, ...
我去掉一个0后能使用10位的除数能返回数据,但不是我的需求。
这是否是$mod的bug?
官方文档中没有相关的说明。
I tested it, and now it is:
1. Under mongo shell, the situation is the same as you described;
2. Under mongodb driver 2.2.24, the situation is the same as you described;
3.mongoose driver 4.7.9,
It is recommended to visit: https://jira.mongodb.org/secu... ; and submit an issue for tracking.
For reference.
Love MongoDB! Have Fun!
------------------------Gorgeous separator--------------------- ----------
MongoDB Chinese community has many offline activities, please click below:
2017 Huashan Sword Discussion|MongoDB Chinese Community
Hangzhou Station is coming in March! ! ! Interested friends please sign up quickly! ! !