From 2591735d21b50df5bda3593a11691dbd3f76bd6f Mon Sep 17 00:00:00 2001 From: Amr <39915155+amrmabdelazeem@users.noreply.github.com> Date: Wed, 12 Apr 2023 13:18:57 +0200 Subject: [PATCH 1/2] Update Documents to fit mongodb compass As Robo3T is not available anymore and the docs are outdated, this is how to insert a many documents within MongoDB compass --- README.md | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6edd67d..433b58e 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,26 @@ ## Example Documents ``` -{ - "_id" : ObjectId("5c139771d79ac8eac11e754a"), - "title" : "API", - "content" : "API stands for Application Programming Interface. It is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer." -} - - -{ - "_id" : ObjectId("5c1398aad79ac8eac11e7561"), - "title" : "Bootstrap", - "content" : "This is a framework developed by Twitter that contains pre-made front-end templates for web design" -} - - -{ - "_id" : ObjectId("5c1398ecd79ac8eac11e7567"), - "title" : "DOM", - "content" : "The Document Object Model is like an API for interacting with our HTML" -} +[ + { "_id":{ + "$oid":"5c139771d79ac8eac11e754a" + }, + "title" : "API", + "content" : "API stands for Application Programming Interface. It is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer." + }, + { "_id":{ + "$oid":"5c1398aad79ac8eac11e7561" + }, + "title" : "Bootstrap", + "content" : "This is a framework developed by Twitter that contains pre-made front-end templates for web design" + }, + { "_id":{ + "$oid":"5c1398ecd79ac8eac11e7567" + }, + "title" : "DOM", + "content" : "The Document Object Model is like an API for interacting with our HTML" + } +] ``` ## Server Starting Code From 32dc846644c00706f05ff08af7b3c8c274b38b75 Mon Sep 17 00:00:00 2001 From: Amr <39915155+amrmabdelazeem@users.noreply.github.com> Date: Thu, 13 Apr 2023 15:34:31 +0200 Subject: [PATCH 2/2] Update README.md Update the JSON format for to insert docs into the database --- README.md | 63 +++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 433b58e..4bf39c9 100644 --- a/README.md +++ b/README.md @@ -53,39 +53,32 @@ app.listen(3000, function() { ## Re-populate Database ``` - -{ - "_id" : "5c18e1892998bdb3b3d355bf", - "title" : "REST", - "content" : "REST is short for REpresentational State Transfer. IIt's an architectural style for designing APIs." -} - - -{ - "_id" : ObjectId("5c139771d79ac8eac11e754a"), - "title" : "API", - "content" : "API stands for Application Programming Interface. It is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer." -} - - -{ - "_id" : ObjectId("5c1398aad79ac8eac11e7561"), - "title" : "Bootstrap", - "content" : "This is a framework developed by Twitter that contains pre-made front-end templates for web design" -} - - -{ - "_id" : ObjectId("5c1398ecd79ac8eac11e7567"), - "title" : "DOM", - "content" : "The Document Object Model is like an API for interacting with our HTML" -} - - -{ - "_id" : "5c18f35cde40ab6cc551cd60", - "title" : "Jack Bauer", - "content" : "Jack Bauer once stepped into quicksand. The quicksand couldn't escape and nearly drowned.", - "__v" : 0 -} +[ { + "_id": "5c18e1892998bdb3b3d355bf", + "title": "REST", + "content": "REST is short for REpresentational State Transfer. IIt's an architectural style for designing APIs." + }, + + { + "_id": "5c139771d79ac8eac11e754a", + "title": "API", + "content": "API stands for Application Programming Interface. It is a set of subroutine definitions, communication protocols, and tools for building software. In general terms, it is a set of clearly defined methods of communication among various components. A good API makes it easier to develop a computer program by providing all the building blocks, which are then put together by the programmer." + }, + { + "_id": "5c1398aad79ac8eac11e7561", + "title": "Bootstrap", + "content": "This is a framework developed by Twitter that contains pre-made front-end templates for web design" + }, + { + "_id": "5c1398ecd79ac8eac11e7567", + "title": "DOM", + "content": "The Document Object Model is like an API for interacting with our HTML" + }, + { + "_id": "6437f9deacfdb7828803875c", + "title": "Jack Bauer", + "content": "Jack Bauer once stopped into quicksand. The quicksand couldn't escape and nearly drowned.", + "__v": 0 + } +] ```