The _id property in the context of MongoDB

To kick off our discussion of the _id property, let's go ahead and rerun the mongodb-connect file. This is going to insert a new document into the Users collection, like we've defined in the db.collection line. I'm going to go ahead and do that by running the file through the node. It's in the playground folder, and the file itself is called mongodb-connect.js:

node playground/mongodb-connect.js

I'm going to run the command, and we're going to print out the document that got inserted:

As we've seen in the past, we get our three attributes as well as the one added by Mongo.

The first thing you'll notice ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.