0

I am just started learning Mongo DB and wanted to insert some data in my DB. But I am getting errors:

Running below code gives me error in Mongo shell:

document = ( { "Type" : "Book", "Title" : "Definitive Guide to MongoDB 2nd ed.,", "ISBN" : "978-1-4302-5821-6", "Publisher" : "Apress", "Author": ["Hows, David", "Plugge, Eelco", "Membrey, Peter", “Hawkins, Tim” ] } )

E QUERY    SyntaxError: Unexpected token ILLEGAL

Can you please help me what is the issue with this code?

After creating the document I wanted to insert in my DB using command.

db.media.insert(document)

1 Answer 1

1

In your code, at the end, you have

“Hawkins, Tim”

which should be

"Hawkins, Tim"

You have curly quotes instead of straight quotes.

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.