2016-09-14 84 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 }) 
相關問題