According to tie piece of documentation if I run these upon mongosh:
use myDB
db.myNewCollection1.insertOne( { x: 1 } )
Will automatically create a myDb
database and will a collection myNewCollection1
.
Therefore if upon my nodejs run:
const {MongoClient, ServerApiVersion} = require('mongodb')
// Connectionstring
const uri = 'mongodb://root:example@127.0.0.1:27017/';
//
…
Top comments (0)