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:
steevej
(Steeve Juneau)
September 2, 2023, 2:09pm
3
From the prompt string
Brijesh_Shekhda:
root@mongodb:/app#
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.
steevej
(Steeve Juneau)
September 2, 2023, 3:09pm
5
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
1 Like
steevej
(Steeve Juneau)
September 2, 2023, 9:58pm
7
In case you need more proof that reading is hard.
I really must improve my reading skills. B-)
~~ /) ~~