2
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?"}
我應該按順序使用什麼樣的查詢來實現這一目標?
這顯然有很大幫助。至少我不會瀏覽互聯網幾個小時,以發現它現在(幾乎)不可能。萬分感謝 – Keil 2012-04-12 23:07:07