MongoDB
C100DBA · Question #63
C100DBA Question #63: Real Exam Question with Answer & Explanation
Sign in or unlock C100DBA to reveal the answer and full explanation for question #63. The question stem and answer options stay visible for context.
Question
The difference between $push and $addToSet is:
Options
- A$addToSet needs the fields to be already present while $push will work even if the field is not
- B$addToSet adds the item to the field only if it does not exist already; while $push pushes the item
- C$addToSet adds the item to the field only if the new item is of the same datatype
- DThere is no major difference between them. $addToSet is a deprecated version of $push.
Unlock C100DBA to see the answer
You've previewed enough free C100DBA questions. Unlock C100DBA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.