"$inc" and $push double quotes syntax

I’m a complete beginner to MongoDB so guessing this is not important, but I noticed in the slide shown at 4mins 48secs (M001 chapter 3, updating with shell) that "$inc" and "$set" are in double quotes but $push is not. Though when the instructor uses "$push" in the shell it is in double quotes. A quick google comes up with docs using no double quotes.
Finding the course great btw.

The fact that you may get away without quotes in the mongo shell is an artifact that the shell is JavaScript and that you do not need quotes for label.

Personally, I prefer to always use double quotes because I am using other languages that require double quotes for all literals.

4 Likes

Ah I see, that makes sense, thanks!

1 Like