MongoDB C100DBA Exam - Topic 1 Question 37 Discussion
The difference between $push and $addToSet is:
B) $addToSet adds the item to the field only if it does not exist already; while $push pushes the item to the field irrespective of whether it was present or not
A) $addToSet needs the fields to be already present while $push will work even if the field is not present
C) $addToSet adds the item to the field only if the new item is of the same datatype
D) There is no major difference between them. $addToSet is a deprecated version of $push.
Mattie
8 months agoRebecka
9 months agoNorah
9 months agoEzekiel
9 months agoNaomi
9 months agoFranklyn
9 months agoDelmy
9 months agoMerilyn
9 months agoWhitney
9 months agoKeneth
9 months agoAdell
9 months ago