MongoDB 内嵌文档的读取和更新删除
C# 调用MongoDb.Dirver驱动时(2.4.4)
数据库结构:
{ "_id" : ObjectId("599d55bd86ecc739ecb2a519"), "State" : null, "CreateTime" : null, "UpdateTime" : null, "sid" : 1, "cjtid" : 1, "products" : [ { "_id" : ObjectId("599d55ba86ecc739ecb2a518"), "State" : null, "CreateTime" : null, "UpdateTime" : null, "uniacid" : 8, "sid" : 1, "cid" : 20000, "title" : "", "number" : "3600001", "price" : "11.00", "total" : "10", "status" : 1, "thumb" : "" } ] }
1.是否有方法可以在查询时直接返回内嵌文档中和条件相匹配的数据。
如:查询product中price==11.00的数据,则只返回那一条数据。
2.内嵌文档 替换、修改、删除时,又怎么单独对内嵌文档进行操作