I was get error during the MondoDB university courses i try all the things but all time it gave same error

root@mongodb:/app# db.accounts.insert({account_id: 111333,limit: 12000, products: [“Commodity”,“Brokerage”],“last_updated”: new Date()})
bash: syntax error near unexpected token `{account_id:’

**This error is on MongoDB lab which is online lab environment **

If the labs is using a modern shell try insertOne or insertMany as insert is deprecated:

From the prompt string

which looks like a bash shell prompt, I assume that you are not connected to the database with mongosh.

Try to connect with mongosh as instructed.

2 Likes

That makes a lot more sense, not sure how I missed that…but the insert comment still stands once you connect as that call will probably give a warning.

My favorite quote since I often am a monkey.

Saru mo ki kara ochiru

In reality I know how I missed that…apparently reading is indeed hard :slight_smile:

1 Like

In case you need more proof that reading is hard.