Home > Net >  How to export script create database in MongoDB?
How to export script create database in MongoDB?

Time:11-10

In MS SQL Server, after creating database completely, we have file script.sql and anyone want to create our database, they just need to run that file script.sql

I don't know whether if we can export that kind of file in MongoDB ?

CodePudding user response:

mongoDB is "schema less" database system meaning that you can insert data without the initial schema definition like in MS SQL Server. You may create your indexes at later stage and prapare a .js file to execute it every time if you want to have the same indexes every time in new deployments or you can make initial empty mongodump and do mongorestore every time you need same indices.

  • Related