Mongodb error importing bson file

just installed mongodb 4.0.2, you can view the default database normally:

> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB



but importing bson data shows an error:

> mongorestore -h localhost:27017 -d test D:/wnmp/www/project_name/db/bson_backup/addresses.bson
2018-08-31T18:52:19.949+0800 E QUERY    [js] SyntaxError: missing ; before statement @(shell):1:16

What is the reason for

?

May.22,2021

mongorestore is a stand-alone executable program, please do not execute it while entering the command line state of mongodb!
Open a separate command line window to execute your commands.


the error message shows that there is a syntax error in your command. I have not used mongodb, on windows. Try changing the / of the path to\

.
Menu