7
這將是一個愚蠢的問題,但如果我有一個蒙戈對象,它是這種格式:使用find()來搜索嵌套鍵MongoDB中
{
"url": "google.com",
"statusCode": 301,
"headers": {
"location": "http://www.google.com/",
"content-type": "text/html; charset=UTF-8",
"date": "Fri, 22 Mar 2013 16:27:55 GMT",
"expires": "Sun, 21 Apr 2013 16:27:55 GMT",
"cache-control": "public, max-age=2592000",
"server": "gws",
"content-length": "219",
"x-xss-protection": "1; mode=block",
"x-frame-options": "SAMEORIGIN"
}
}
使用db.collections.find()
,我怎麼找server
密鑰或嵌套在另一個密鑰中的任何密鑰?
我已經試過db.collections.find({headers:{server:"gws"}})
我已經嘗試了所有可能的組合引述他們,但輸出一直是空白,或...
任何建議,將不勝感激。