Question: I am trying to figure out if I can create a new database in MongoDB with Mongoose. I am running on Node, and I know the MongoDB driver for Node can do it, but I am wondering if I can do it just from Mongoose.

Is there an equivalent to the `db.createCollection(name, options)` from the Node MongoDB driver in Mongoose? My google skills are failing right now.

I just was trying to figure out if I had to install the whole MongoDB driver just for that, but I think I do.

Answer: 
If you want to create database for online cluster you also need to enter your database name when you pass the uri like:-

> 
> `"mongodb+srv://<Username>:<Password>@resumeapp.3ditras.mongodb.net/<DatabaseName>?retryWrites=true&w=majority"`
> 
> 
>
Just Try this code it's very simple and clean

```
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost:27017/yourdatabasename').then(() => console.log('Connected to MongoDB...')).catch((err) => console.error("Coudn't connect MongoDB....", err));

const customerSchema= new mongoose.Schema({ name: String,address: String,email:String,});

const Customer= mongoose.model('Customer',courseSchema);

async function createNewCustomer() {const customer= new Customer({name: 'new customer',address: 'new address',email: 'customer1@new.com',});const result = await customer.save();console.log(result);
}
createNewCustomer();

```