diff options
Diffstat (limited to '')
-rw-r--r-- | put_in_db.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/put_in_db.js b/put_in_db.js index a9906a3..fadcc42 100644 --- a/put_in_db.js +++ b/put_in_db.js @@ -35,6 +35,9 @@ blogs = [ ]; // db.blogposts.insertMany([blog_entry_1, blog_entry_2, blog_entry_3]); -db.blogposts.updateMany(blogs, { - upsert: true, -}); +db.blogposts.updateMany( + { $set: blogs }, + { + upsert: true, + } +); |