{"id":73334,"date":"2020-01-15T16:44:24","date_gmt":"2020-01-15T11:14:24","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=73334"},"modified":"2024-04-12T14:27:14","modified_gmt":"2024-04-12T08:57:14","slug":"mongodb-4","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/","title":{"rendered":"mongodb"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/mean-stack-tutorials\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to Tutorial<\/a><\/p>\n\n\n<p>The official MongoDB Node.js driver provides both callback-based and Promise-based interaction with MongoDB, allowing applications to take full advantage of the new features in ES6. The 2.x series of the driver is powered by a brand new core driver and BSON library.<\/p>\n<ul>\n<li>A brand new MongoDB driver for Node.js that keeps compatibility with the 1.4.x driver series, only breaking behavior where the 1.4.x branch had significant problems. The driver also includes support for the shared CRUD API specification and the Server Discovery and Monitoring Specification (SDAM).<\/li>\n<li>The MongoDB Node.js core driver is the new underpinning for the driver and is meant for framework developers that do not need the helpers and abstractions available in the full driver. This driver is not meant for end users, as it offers none of the conveniences of the higher level APIs.<\/li>\n<\/ul>\n<p>Given that you have created your own project using `npm init` we install the mongodb driver and it&#8217;s dependencies by executing the following `NPM` command.<\/p>\n<p>npm install mongodb &#8211;save<\/p>\n<p>This will download the MongoDB driver and add a dependency entry in your `package.json` file.<\/p>\n<p><strong>Insert Documents<\/strong><\/p>\n<p>The insertOne and insertMany methods exist on the Collection class and are used to insert documents into MongoDB.<\/p>\n<p>const MongoClient = require(&#8216;mongodb&#8217;).MongoClient;<\/p>\n<p>const assert = require(&#8216;assert&#8217;);<\/p>\n<p>\/\/ Connection URL<\/p>\n<p>const url = &#8216;mongodb:\/\/localhost:27017&#8217;;<\/p>\n<p>\/\/ Database Name<\/p>\n<p>const dbName = &#8216;myproject&#8217;;<\/p>\n<p>\/\/ Create a new MongoClient<\/p>\n<p>const client = new MongoClient(url);<\/p>\n<p>\/\/ Use connect method to connect to the Server<\/p>\n<p>client.connect(function(err, client) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>console.log(&#8220;Connected correctly to server&#8221;);<\/p>\n<p>const db = client.db(dbName);<\/p>\n<p>\/\/ Insert a single document<\/p>\n<p>db.collection(&#8216;inserts&#8217;).insertOne({a:1}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(1, r.insertedCount);<\/p>\n<p>\/\/ Insert multiple documents<\/p>\n<p>db.collection(&#8216;inserts&#8217;).insertMany([{a:2}, {a:3}], function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(2, r.insertedCount);<\/p>\n<p>client.close();<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>The first insert inserts a single document into the inserts collection. Notice that there\u2019s no need to explicitly create a new inserts collection, as the server will create it implicitly when the first document is inserted. The method db.createIndex is only necessary when creating non-standard collections, such as capped collections or where parameters other than the defaults are necessary.<\/p>\n<p>The insertOne and insertMany methods also accept a second argument which can be an options object. This object can have the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<td width=\"156\"><strong>Parameter <\/strong><\/td>\n<td width=\"213\"><strong>Type <\/strong><\/td>\n<td width=\"270\"><strong>Description<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"156\">w<\/td>\n<td width=\"213\">{Number\/String, &gt; -1 || \u2018majority\u2019}<\/td>\n<td width=\"270\">the write concern for the operation where &lt; 1 returns an acknowledgment of the write with not results {ok:1} and w &gt;= 1 or w = \u2018majority\u2019 acknowledges the write with full write results.<\/td>\n<\/tr>\n<tr>\n<td width=\"156\">wtimeout<\/td>\n<td width=\"213\">{Number, 0}<\/td>\n<td width=\"270\">set the timeout for waiting for write concern to finish (combines with w option).<\/td>\n<\/tr>\n<tr>\n<td width=\"156\">j<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"270\">write waits for journal sync.<\/td>\n<\/tr>\n<tr>\n<td width=\"156\">serializeFunctions<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"270\">serialize functions on an object to mongodb, by default the driver does not serialize any functions on the passed in documents.<\/td>\n<\/tr>\n<tr>\n<td width=\"156\">forceServerObjectId<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"270\">Force server to assign _id values instead of driver.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Updating Documents<\/strong><\/p>\n<p>The updateOne and updateMany methods exist on the Collection class and are used to update and upsert documents.<\/p>\n<p>const MongoClient = require(&#8216;mongodb&#8217;).MongoClient;<\/p>\n<p>const assert = require(&#8216;assert&#8217;);<\/p>\n<p>\/\/ Connection URL<\/p>\n<p>const url = &#8216;mongodb:\/\/localhost:27017&#8217;;<\/p>\n<p>\/\/ Database Name<\/p>\n<p>const dbName = &#8216;myproject&#8217;;<\/p>\n<p>\/\/ Create a new MongoClient<\/p>\n<p>const client = new MongoClient(url);<\/p>\n<p>\/\/ Use connect method to connect to the Server<\/p>\n<p>client.connect(function(err, client) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>console.log(&#8220;Connected correctly to server&#8221;);<\/p>\n<p>const db = client.db(dbName);<\/p>\n<p>const col = db.collection(&#8216;updates&#8217;);<\/p>\n<p>\/\/ Insert a single document<\/p>\n<p>col.insertMany([{a:1}, {a:2}, {a:2}], function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(3, r.insertedCount);<\/p>\n<p>\/\/ Update a single document<\/p>\n<p>col.updateOne({a:1}, {$set: {b: 1}}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(1, r.matchedCount);<\/p>\n<p>assert.equal(1, r.modifiedCount);<\/p>\n<p>\/\/ Update multiple documents<\/p>\n<p>col.updateMany({a:2}, {$set: {b: 1}}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(2, r.matchedCount);<\/p>\n<p>assert.equal(2, r.modifiedCount);<\/p>\n<p>\/\/ Upsert a single document<\/p>\n<p>col.updateOne({a:3}, {$set: {b: 1}}, {<\/p>\n<p>upsert: true<\/p>\n<p>}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(0, r.matchedCount);<\/p>\n<p>assert.equal(1, r.upsertedCount);<\/p>\n<p>client.close();<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>The update method also accepts a third argument which can be an options object. This object can have the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<td width=\"92\"><strong>Parameter <\/strong><\/td>\n<td width=\"213\"><strong>Type <\/strong><\/td>\n<td width=\"334\"><strong>Description<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"92\">w<\/td>\n<td width=\"213\">{Number\/String, &gt; -1 || \u2018majority\u2019}<\/td>\n<td width=\"334\">the write concern for the operation where &lt; 1 returns an acknowledgment of the write with not results {ok:1} and w &gt;= 1 or w = \u2018majority\u2019 acknowledges the write with full write results.<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">wtimeout<\/td>\n<td width=\"213\">{Number, 0}<\/td>\n<td width=\"334\">set the timeout for waiting for write concern to finish (combines with w option).<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">j<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"334\">write waits for journal sync.<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">multi<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"334\">Update one\/all documents with operation.<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">upsert<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"334\">Update operation is an upsert.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Just as for insert, the update method allows you to specify a per operation write concern using the w, wtimeout and fsync parameters.<\/p>\n<p><strong>Removing Documents<\/strong><\/p>\n<p>The deleteOne and deleteMany methods exist on the Collection class and are used to remove documents from MongoDB.<\/p>\n<p>const MongoClient = require(&#8216;mongodb&#8217;).MongoClient;<\/p>\n<p>const assert = require(&#8216;assert&#8217;);<\/p>\n<p>\/\/ Connection URL<\/p>\n<p>const url = &#8216;mongodb:\/\/localhost:27017&#8217;;<\/p>\n<p>\/\/ Database Name<\/p>\n<p>const dbName = &#8216;myproject&#8217;;<\/p>\n<p>\/\/ Create a new MongoClient<\/p>\n<p>const client = new MongoClient(url);<\/p>\n<p>\/\/ Use connect method to connect to the Server<\/p>\n<p>client.connect(function(err, client) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>console.log(&#8220;Connected correctly to server&#8221;);<\/p>\n<p>const db = client.db(dbName);<\/p>\n<p>const col = db.collection(&#8216;removes&#8217;);<\/p>\n<p>\/\/ Insert a single document<\/p>\n<p>col.insertMany([{a:1}, {a:2}, {a:2}], function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(3, r.insertedCount);<\/p>\n<p>\/\/ Remove a single document<\/p>\n<p>col.deleteOne({a:1}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(1, r.deletedCount);<\/p>\n<p>\/\/ Update multiple documents<\/p>\n<p>col.deleteMany({a:2}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(2, r.deletedCount);<\/p>\n<p>client.close();<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>The deleteOne and deleteMany methods also accept a second argument which can be an options object. This object can have the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<td width=\"92\"><strong>Parameter <\/strong><\/td>\n<td width=\"213\"><strong>Type <\/strong><\/td>\n<td width=\"334\"><strong>Description<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"92\">w<\/td>\n<td width=\"213\">{Number\/String, &gt; -1 || \u2018majority\u2019}<\/td>\n<td width=\"334\">the write concern for the operation where &lt; 1 returns an acknowledgment of the write with not results {ok:1} and w &gt;= 1 or w = \u2018majority\u2019 acknowledges the write with full write results.<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">wtimeout<\/td>\n<td width=\"213\">{Number, 0}<\/td>\n<td width=\"334\">set the timeout for waiting for write concern to finish (combines with w option).<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">j<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"334\">write waits for journal sync.<\/td>\n<\/tr>\n<tr>\n<td width=\"92\">single<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"334\">Removes the first document found.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Just as for updateOne\/updateMany and insertOne\/insertMany, the deleteOne\/deleteMany method allows you to specify a per operation write concern using the w, wtimeout and fsync parameters.<\/p>\n<p><strong>findOneAndUpdate, findOneAndDelete, and findOneAndReplace<\/strong><\/p>\n<p>The three methods findOneAndUpdate, findOneAndDelete and findOneAndReplace are special commands which allow the user to update or upsert a document and have the modified or existing document returned. When using these methods, the operation takes a write lock for the duration of the operation in order to ensure the modification is atomic.<\/p>\n<p>const MongoClient = require(&#8216;mongodb&#8217;).MongoClient;<\/p>\n<p>const assert = require(&#8216;assert&#8217;);<\/p>\n<p>\/\/ Connection URL<\/p>\n<p>const url = &#8216;mongodb:\/\/localhost:27017&#8217;;<\/p>\n<p>\/\/ Database Name<\/p>\n<p>const dbName = &#8216;myproject&#8217;;<\/p>\n<p>\/\/ Create a new MongoClient<\/p>\n<p>const client = new MongoClient(url);<\/p>\n<p>\/\/ Use connect method to connect to the Server<\/p>\n<p>client.connect(function(err, client) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>console.log(&#8220;Connected correctly to server&#8221;);<\/p>\n<p>const db = client.db(dbName);<\/p>\n<p>const col = db.collection(&#8216;findAndModify&#8217;);<\/p>\n<p>\/\/ Insert a single document<\/p>\n<p>col.insert([{a:1}, {a:2}, {a:2}], function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(3, r.result.n);<\/p>\n<p>\/\/ Modify and return the modified document<\/p>\n<p>col.findOneAndUpdate({a:1}, {$set: {b: 1}}, {<\/p>\n<p>returnOriginal: false<\/p>\n<p>, sort: [[a,1]]\n<p>, upsert: true<\/p>\n<p>}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.equal(1, r.value.b);<\/p>\n<p>\/\/ Remove and return a document<\/p>\n<p>col.findOneAndDelete({a:2}, function(err, r) {<\/p>\n<p>assert.equal(null, err);<\/p>\n<p>assert.ok(r.value.b == null);<\/p>\n<p>client.close();<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>});<\/p>\n<p>The findOneAndUpdate method also accepts a third argument which can be an options object. This object can have the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<td width=\"117\"><strong>Parameter <\/strong><\/td>\n<td width=\"213\"><strong>Type <\/strong><\/td>\n<td width=\"308\"><strong>Description<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td width=\"117\">w<\/td>\n<td width=\"213\">{Number\/String, &gt; -1 || \u2018majority\u2019}<\/td>\n<td width=\"308\">the write concern for the operation where &lt; 1 returns an acknowledgment of the write with not results {ok:1} and w &gt;= 1 or w = \u2018majority\u2019 acknowledges the write with full write results.<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">wtimeout<\/td>\n<td width=\"213\">{Number, 0}<\/td>\n<td width=\"308\">set the timeout for waiting for write concern to finish (combines with w option).<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">j<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"308\">write waits for journal sync.<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">upsert<\/td>\n<td width=\"213\">(Boolean, default:false)<\/td>\n<td width=\"308\">Perform an upsert operation.<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">sort<\/td>\n<td width=\"213\">(Object, default:null)<\/td>\n<td width=\"308\">Sort for find operation.<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">projection<\/td>\n<td width=\"213\">(Object, default:null)<\/td>\n<td width=\"308\">Projection for returned result<\/td>\n<\/tr>\n<tr>\n<td width=\"117\">returnOriginal<\/td>\n<td width=\"213\">(Boolean, default:true)<\/td>\n<td width=\"308\">Set to false if you want to return the modified object rather than the original. Ignored for remove.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The findOneAndDelete function is designed to help remove a document.<\/p>\n\n\n<p><a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/mean-stack-tutorials\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to Tutorial<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to Tutorial The official MongoDB Node.js driver provides both callback-based and Promise-based interaction with MongoDB, allowing applications to take full advantage of the new features in ES6. The 2.x series of the driver is powered by a brand new core driver and BSON library. A brand new MongoDB driver for Node.js that keeps&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8514],"tags":[6738],"class_list":["post-73334","page","type-page","status-publish","hentry","category-mean-stack","tag-mongodb"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>mongodb - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mongodb - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Go back to Tutorial The official MongoDB Node.js driver provides both callback-based and Promise-based interaction with MongoDB, allowing applications to take full advantage of the new features in ES6. The 2.x series of the driver is powered by a brand new core driver and BSON library. A brand new MongoDB driver for Node.js that keeps...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:57:14+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/\",\"name\":\"mongodb - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2020-01-15T11:14:24+00:00\",\"dateModified\":\"2024-04-12T08:57:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mongodb\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"mongodb - Tutorial","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/","og_locale":"en_US","og_type":"article","og_title":"mongodb - Tutorial","og_description":"Go back to Tutorial The official MongoDB Node.js driver provides both callback-based and Promise-based interaction with MongoDB, allowing applications to take full advantage of the new features in ES6. The 2.x series of the driver is powered by a brand new core driver and BSON library. A brand new MongoDB driver for Node.js that keeps...","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:57:14+00:00","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/","name":"mongodb - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2020-01-15T11:14:24+00:00","dateModified":"2024-04-12T08:57:14+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/mongodb-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"mongodb"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/73334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=73334"}],"version-history":[{"count":4,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/73334\/revisions"}],"predecessor-version":[{"id":87769,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/73334\/revisions\/87769"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=73334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=73334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=73334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}