Package Exports
- mongo-json-escape
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mongo-json-escape) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mongo-json-escape
Escape MongoDB reserved characters $
and .
from JSON objects. This way you can store JSON objects containing these characters in your database.
Installation
$ npm install mongo-json-escape
Example
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"});
License
MIT