I am using a windows batch file that will output a .js file into csv.
The .js file is a mongo query.
mongosh --host 10.1.0.1:27017 --username "username" --password "password" --authenticationDatabase admin --quiet C:\ActiveUsers1.js > C:\ActiveUsers.csv
mongosh --host 10.1.0.1:27017 --username "username" --password "password" --authenticationDatabase admin --quiet C:\ActiveUsers2.js >> C:\ActiveUsers.csv
mongosh --host 10.1.0.1:27017 --username "username" --password "password" --authenticationDatabase admin --quiet C:\ActiveUsers3.js >> C:\ActiveUsers.csv
Sample result for each .js file
ActiveUsers1.js = 10
ActiveUsers2.js = 15
ActiveUsers3.js = 20
What I want to have on my ActiveUsers.csv file should be:
10
15
20
What I am getting is:
101520
I just upgraded into mongosh and I am not encountering this when using the old mongo shell (mongo).
Is there a way that I could control this on a .bat file?