From 652832c70b781928ede9f94541601c1beb21dfaa Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 17 Nov 2023 00:21:27 -0500 Subject: fixing the duplication issue --- mds/oneclientforeverything.md | 2 +- put_in_db.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mds/oneclientforeverything.md b/mds/oneclientforeverything.md index 16fd640..e262815 100644 --- a/mds/oneclientforeverything.md +++ b/mds/oneclientforeverything.md @@ -16,7 +16,7 @@ I can't be bothered to have different clients open all the time. I want to have ## Two ways of solving this -There is generally two ways one can try to solve this. number one is to just use a browser. Almost all forms of comm nowadays have a web client so basically one way of solving our problem is to a dedicated browser that has all the clients open. Mind you, there are even specialized and more lightweight browser offerings specifically geared towards this use-case but still this option is not ideal in terms of resources and the interface you're getting is not really unified.
+There is generally two ways one can try to solve this. Number one is to just use a browser. Almost all forms of comm nowadays have a web client so basically one way of solving our problem is to a dedicated browser that has all the clients open. Mind you, there are even specialized and more lightweight browser offerings specifically geared towards this use-case but still this option is not ideal in terms of resources and the interface you're getting is not really unified.
### The web app way 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, + } +); -- cgit v1.2.3