how can you push json internal relational data to mongodb?

The default unique primary key in the MongoDB document is _id. When you insert a new document, it returns the unique id of the record that inserted (created).

The value inside this id is ObjectId who creates based on time. you can read about it here.

If you want to use your own value for the _id, have to pass it when you call the insert, like this:

db.directors.insertOne({_id: '1a', name: 'Tarantino'})

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top