Use of addtoset operator in mongoose

Опубликовано: 09 Июнь 2026
на канале: Debasis Kar
196
2

The $addToSet operator adds a value to an array unless the value is already present, in which case $addToSet does nothing to that array.

$addToSet only ensures that there are no duplicate items added to the set and does not affect existing duplicate elements. $addToSet does not guarantee a particular ordering of elements in the modified set.

Refarence Link :
https://angular.io/guide/sharing-ngmo...