What is causing this Syntax error?

what is causing the syntax error in the 15th position of my query.

Try to remove extra space before birth_place at two places

Hi, did the changes but It is showing the same error…moreover i dont think having space between inverted commas causes syntax error…

It could be double quotes issue
Don’t copy & paste
Try to type and use double straight quotes

1 Like

It works when double quotes are changed from “ ” to " " . but why is this an issue, when the syntax is correct ?


Hi @Anugata_Santra

It’s because the characters “ ” (so-called “smart quotes”) are not recognized as quotes since they’re not ASCII characters. From the interpreter’s point of view, it’s an invalid character, thus it’s a syntax error.

Note that this behaviour is not limited to MongoDB or even Javascript. This quoting issue is pretty much universal across all programming languages and compilers, and was typically caused by copy-pasting from a web page into a terminal window or text editor (which @Ramachandra_Tummala alluded to earlier).

Best regards


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.