MongoDB

suggest change

Remarks

The hardest part is attaching a subdocument to a document that does not exist yet. To get the expected shape, iterate the array with a for loop into a variable and call $doc2.add("Key", "Value"), rather than using foreach on the current array with an index. The subdocument is then assigned in two lines, as in "Tags" = [MongoDB.Bson.BsonDocument] $doc2.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents