首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何查询MongoDB?

如何查询MongoDB?
EN

Stack Overflow用户
提问于 2017-04-18 06:24:11
回答 1查看 99关注 0票数 0

我只是创建了一个集合,并试图查询文档中的某些对象,但我似乎没有得到任何结果。顺便说一句,我使用Robomongo作为mongoDB.These的图形用户界面是我的文档。

代码语言:javascript
复制
/* 1 */
{
"_id" : ObjectId("58f58ba6739e558ced008df1"),
"Inventory for NTA SAM Cards" : "Item no.",
"Item Description" : "",
"Opening QTY" : "",
"Issued QTY" : "",
"Corrupted QTY" : "",
"Closing QTY" : ""
}

/* 2 */
{
"_id" : ObjectId("58f58f23739e558ced008e3d"),
"Inventory for NTA SAM Cards" : "01",
"Item Description" : "EZ-Link SAM (Blank)",
"Opening QTY" : "165",
"Issued QTY" : "65",
"Corrupted QTY" : "0",
"Closing QTY" : "100",
"Remarks" : "Received 100 blank SAMS from Geraldine on 4/1/15"
 }

/* 3 */
{
"_id" : ObjectId("58f58f9c739e558ced008e47"),
"Inventory for NTA SAM Cards" : "02",
"Item Description" : "EZ-Link SAM (Test)",
"Opening QTY" : "220",
"Issued QTY" : "184",
"Corrupted QTY" : "0",
"Closing QTY" : "36",
"Remarks" : "updated 7/11/16"
 }

 /* 4 */
 {
"_id" : ObjectId("58f58fcd739e558ced008e4d"),
"Inventory for NTA SAM Cards" : "03",
"Item Description" : "EZL Production SAM",
"Opening QTY" : "998",
"Issued QTY" : "996",
"Corrupted QTY" : "0",
"Closing QTY" : "2",
"Remarks" : "updated 11/11/2016 150 moved to 18.Auresys Prod"
 }

 /* 5 */
 {
"_id" : ObjectId("58f59034739e558ced008e57"),
"Inventory for NTA SAM Cards" : "04",
"Item Description" : "Payment Link SAM",
"Opening QTY" : "500",
"Issued QTY" : "500",
"Corrupted QTY" : "0",
"Closing QTY" : "0",
"Remarks" : ""
 }

 /* 6 */
{
"_id" : ObjectId("58f5a1b2739e558ced008f2e"),
"Inventory for NTA SAM Cards" : "05",
"Item Description" : "MEA Production SAM",
"Opening QTY" : "434",
"Issued QTY" : "393",
"Corrupted QTY" : "0",
"Closing QTY" : "41",
"Remarks" : ""
}

有人知道问题出在哪里吗?我的疑问是

代码语言:javascript
复制
 db.documents.find({"Inventory for NTA SAM Cards":"01"})

我一直拿着这个

代码语言:javascript
复制
Fetched 0 record(s) in 2ms

我的收藏品叫文件。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-18 06:47:20

尝试这个查询

代码语言:javascript
复制
db.documents.find( { Inventory for NTA SAM Cards: { $eq: "01" } } )

参考休整此链接

db.collection.find

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43465026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档