This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This copies data from the mongodb collection <collection1> to <collection2> preserving the _id field, it will skip if the _id already exists | |
console.log('Starting mongodb fixes'); | |
var url = "mongodb+srv://<username>:<password>@<clustername>.mongodb.net/<dbname>?retryWrites=true&w=majority"; | |
const { MongoClient } = require('mongodb'); | |
var fs = require('fs'); | |
const databaseName = '<database_name>'; | |
const collectionOne = 'collection1'; | |
const collectionTwo = 'collection2'; | |
let continueProcessing = true; |