A
A
Andrey Ivanov2020-08-12 21:07:30
MongoDB
Andrey Ivanov, 2020-08-12 21:07:30

MongoDB migration not working, why?

Downloaded the migration package migrate-mongo

Configuration

const path = require('path');
const dotenv = require('dotenv').config({ path: path.resolve(__dirname, '../.env') })

const config = {
  mongodb: {
    url: dotenv.parsed.DATABASE_HOST,
    databaseName: dotenv.parsed.DB_NAME,
    options: {
      useNewUrlParser: true,
      useUnifiedTopology: true,
    }
  },
  migrationsDir: "migrations",
  changelogCollectionName: "changelog",
  migrationFileExtension: ".js"
};

module.exports = config;


All variables and passwords are readable and 100% correct - checked.
I start , migrate-mongo upI get ERROR: Authentication failed.

In one chat, they suggested that you can write the migration mechanism yourself, but I still do not have enough information and experience. Can someone tell me how to write the migration mechanism itself.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question