> db.shop.insert({name:'njy',spec:{weight:200,area:'taiwang'}});
WriteResult({ "nInserted" : 1 })
> db.shop.insert({name:'sanxing',spec:{weight:300,area:'hanguo'}});
WriteResult({ "nInserted" : 1 })
查询 规格(spec)中地区(area)是hanguo的
> db.shop.find({'spec.area':'hanguo'})
{ "_id" : ObjectId("5faa5242ce5d807f03bad107"), "name" : "sanxing", "spec" : { "weight" : 300, "area" : "hanguo" } }
博客围绕MongoDB的子查询展开,虽未给出具体内容,但可知聚焦于该数据库的子查询技术,这在后端开发的数据处理中较为重要。
761

被折叠的 条评论
为什么被折叠?



