Help! I don't what am doing wrong, when I try to update an existing field using the $set method the entire document gets removed.
Can you kindly point out what I am doing wrong in my code:
recipientsDetails.update({_id: "GCYmFqZbaaYD7DvMZ"}, {$set: {paymentStatus: "Approved"}});
Thanks for your help!
The code is correct. It's likely that your publish function for
recipientsDetails
containsrecipientsDetails.find({paymentStatus: "Not Approved"})
. Naturally, once you update the document, the document will no longer satisfy that filtering query and the document vanish from the client.