Escape MongoDB reserved characters $
and .
from JSON objects. This way you can store JSON objects containing these characters in your database.
$ npm install mongo-json-escape
var mje = require('mongo-json-escape');
mje.escape({"hello.world":"hello"});
mje.unescape({"hello\uFF0Eworld":"hello");
key.escape({"hello$world":"hello"});
key.unescape({"hello\uFF04world":"hello"});
MIT