DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

Will nodejs' mongodb client will create a new db for me?

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)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay