基于此:
db.room.save({name:'public',msg:[{to:'Jo',msg:'whats up'},{to:'Jo',msg:'dude?'}]})
db.room.find()
> { "_id" : ObjectId("4f86282a87850ac4bfe9a664"), "name" : "public", "msg" : [ { "to" : "Jo", "msg" : "whats up" }, { "to" : "Jo", "msg" : "dude?" } ] }
我想得到以下结果:
db.room.find(????)
> {"name" : "public", "to" : "Jo", "msg" : "whats up"}
> {"name" : "public", "to" : "Jo", "msg" : "dude?"}
我应该使用什么查询来实现这一点?