Skip to content

Rashik004/node_mongo_migrator

Repository files navigation

Mongodb database migration on top of nodejs and express js

License: MIT This is a test project to test how nodeJs migration works with [migrate-mongo].(https://github.com/seppevs/migrate-mongo#readme)

Running The GUI

Once the server is successfully started, you should see a log like below:

	Express server started at port : 3000
	MongoDB Connection Succeeded.

You can add new data by clicking create new or just run the seed data migration to add data.

Running the migrations

First you need to create a migration file, to create migration file, go to powershell terminal and write following command:

	migrate-mongo create [you-migration-name]

A new file will be created starting with the creation timestamp and followed by migration name. in this new file you can copy paste code from one of the files from sample-migrations directory.

for example: The newly added migration:

after adding the migration run this command:

	migrate-mongo up

new data will be added in the database.

database after running this command:

list page command after running the migration:

other migrate-mongo commands to explore:

	migrate-mongo status
	migrate-mongo down

Please see the sample-migrations folder for further examples.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published