[DOCS-3602] It would be nice to clarify the behaviour when using $addToSet to add subdocuments to an array Created: 16/Jun/14  Updated: 16/Mar/15  Resolved: 27/Jun/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.7

Type: Improvement Priority: Major - P3
Reporter: Linda Qin Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Participants:
Days since reply: 9 years, 33 weeks, 5 days ago

 Description   

Currently MongoDB compares the subdocuments by comparing the BSON data, and it doesn’t check the contents in the subdocuments. So when you use $addToSet to add subdocuments to an array, if the order of the fields in the subdocuments are different, they would be considered as different documents even if the values for all the fields in the subdocuments are the same.

It would be nice to document this behaviour for $addToSet



 Comments   
Comment by Githook User [ 27/Jun/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3602 behavior of addToSet with a document
Branch: master
https://github.com/mongodb/docs/commit/d96c8ec4a32256d26dc55685dd1ce1cc02a0f8c4

Generated at Thu Feb 08 07:46:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.