mongoexport E QUERY SyntaxError: Unexpected identifier

To import data from the mongodb database today, use the mongoimport command.

Instead, you need to specify the field type, so use

mongoimport –db=users –collection=contacts –type=csv \
–columnsHaveTypes \
–fields=”name.string(),birthdate.date(2006-01-02),contacted.boolean(),followerCount.int32(),thumbnail.binary(base64)” \
–file=/example/file.csv

Don’t look for this. Go directly to the official website.

mongoimport — MongoDB Database Tools

 

Because the error is always reported when using mongoimport.

I think the sentence may be wrong. I have checked it over and over again for more than ten times, but it’s a pity that I still can’t.

 

  See the yellow one?That’s the problem.

Do not execute this command in mongo.exe.

It should be executed under external CMD.

Reference from

mongodb – mongoexport E QUERY SyntaxError: Unexpected identifier – Stack Overflow

Similar Posts: