shlogg · Early preview
Jahid2121 @jahid2121

Update Documents With Just 2 Lines Of Code

Update all documents with just 2 lines of code: `reqMealCollection.updateMany({ status: { $exists: false } }, { $set: { status: "pending" }});

Update all documents with just 2 line of code
Sometimes, we need to add a single field to all the documents in the database of a collection. Adding this field one by one can be time-consuming, especially with large documents. Developer often find themselves daunted by this task. But fear not! you can now accomplish this with just two lines of code. 
here's an example - 
before integrating this code, consider a single object -
{
"_id": "6565c912dc088bc26ee365d0",
"title": "Grilled Chicken Salad",
"image": "https://i.ibb.co/YbPcf1k/khloe-arledge-V7hibs9xhe4-unsplash.jpg",
"category": "lunch",
"p...