During my short use of MongoDB I encountered an issue with double quotes. Since MongoDB stores documents (objects) as JSON fields, key and value pairs, all string values are surrounded with double quotes. Example:
{"name": "Bruce Wayne"}
Although MongoDB will add an escape character if you use double quotes, using double quotes multiple times in the same string will throw an error. To avoid it, I found this handy code snippet that will replace all double quotes with single ones using regex.
Example:
var text = "I'm "Batman" and I'm "Awesome"!"
text = text.replace(/"/g, "'");
console.log(text);
Output:
'I'm 'Batman' and I'm 'Awesome'!'