Answers for "add to a list mongoose"

0

add to a list mongoose

PersonModel.update(
    { _id: person._id }, 
    { $push: { friends: friend } },
    done
);

// if you want unique items only
PersonModel.update(
  { _id: person._id }, 
  { $addToSet: { friends: friend } }
);
Posted by: Guest on September-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language