Home > database >  Read and update delete mongo embedded documents
Read and update delete mongo embedded documents

Time:10-06

C # call mongo. Dirver driver (2.4.4)
The database structure:
{" _id ": ObjectId (" 599 d55bd86ecc739ecb2a519"), "State", null, "CreateTime", null, "UpdateTime", null, "sid" : 1, "cjtid" : 1, the "products" : [{" _id ": ObjectId (" 599 d55ba86ecc739ecb2a518"), "State", null, "CreateTime", null, "UpdateTime", null, "uniacid" : 8, "sid" : 1, "cid" : 20000, "title" : ""," number ":" 3600001 ", "price" : "11.00", "total" : "10", "status" : 1, the "thumb" : ""}]}

1. Is there a method can be directly in the query returns data matching inline documentation and conditions,
Such as: query the product price==11.00 in the data, the one will only return data,
2. Replace the embedded document, modify, delete, and how to separate an embedded document to operate

CodePudding user response:

Products. The price,

CodePudding user response:

https://docs.mongodb.com/manual/tutorial/query-embedded-documents/

CodePudding user response:

Db. Products. Find way how to return a whole article data ~ ~ not I want a child of the document's data,
  • Related