2016-09-14 43 views
2

我想查找所有文档的字段property_id等于-549。我试过了:在mongodb集合中查找字段等于给定整数值的文档

db.getCollection('CollectionName').find({'property_id' : -549 }) 

这不会返回带有消息的记录:“获取0条记录”。

但是我在那里看到文档property_id是-549。 我不知道我在做什么错。字段的类型是int32。

Here are the first two fields of the document that I am looking to find with the query

+0

告诉我们'db.getCollection( 'myCollectionName')找到()' –

+0

https://开头docs.mongodb.com/manual/reference/operator/query/eq/ – ewcz

+0

我该如何显示?它输出20个文件。你想要我截图吗? – Semihcan

回答

0

检查是否有字段名'property_id'空间: 尝试

db.getCollection('CollectionName').find({'\uFEFFproperty_id' : -549 }) 
相关问题