0

I am using this batch script:

mongo.exe mydb < D:\TFX\Delta\script.txt

in which script.txt contains mongodb commands to execute but on running the batch file it only runs the command written in single line and throwing error for commands written in multiple lines so, I need solution to run commands written in multiple lines.

2
  • Try mongo.exe mydb D:\TFX\Delta\script.txt - however the script must have extension .js instead of .txt Commented Apr 6, 2020 at 6:21
  • thank you, will try that and revert back to you. Commented Apr 6, 2020 at 6:23

1 Answer 1

1

try for this script:

mongo.exe mydb < D:\TFX\Delta\script.js

but some times it works with .txt extension too, it was working fine for me earlier.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.