Last active
July 19, 2018 13:45
-
-
Save nirebu/6a02a910e4dd145e9cf85bba76e54f12 to your computer and use it in GitHub Desktop.
[MongoDB batch boilerplate] Basic boilerplate code for mongo shell batch scripts #mongodb
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
print(new Date() + ' Script launched'); | |
const dbName = ""; | |
const inputCollection = ""; | |
const outputCollection = ""; | |
let conn = new Mongo({w:1, journal:false, safe: true}); | |
let dbConn = conn.getDB(dbName); | |
let collIn = dbConn[inputCollection]; | |
let collOut = dbConn[outputCollection]; | |
//BATCH CODE HERE | |
print(new Date() + ' Script ended'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment