A node module which will convert sqlite3 database into a mongo database including indexing
npm install sqlite3-to-mongodbAn utility Node js module which will migrate sqlite3 db to mongo db. For each sqlite table, a collection with the same name as the table name will be created.
npm to download and install:> npm install sqlite3-to-mongodb
```
1)
This method setSqlitePath() will set the sqlite3 db file path which we are gonna migrate to mongo db.
``
2)
This method will set mongo db url for migration.
eg: mongodb://localhost:27017/mydb
``
3)
This method will set the log path.
If the given path is not valid, the default log path ./migration-log.log will be taken.
If you don't use this function, the logs will get consoled.
`
4)
``
This method will start migration and return a promise.
Using Builder design pattern,
let dbMigration = new DBMigration();
let mongodb = "mongodb://localhost:27017/mydb"
let sqlitePath = "./src/sqlitedb.db";
await dbMigration
.setSqlitePath(sqlitePath)
.setMongoUrl(mongodb)
.setLogPath("migration_log.log")
.migrate()
Without using Builder design pattern,
let mongodb = "mongodb://localhost:27017/mydb"
let sqlitePath = "./src/sqlitedb.db";
let dbMigration = new DBMigration(sqlitePath, mongodb, "migration_log.log");
await dbMigration.migrate()