0.0.1 • Published 10 years ago

mongo-json-escape v0.0.1

Weekly downloads
2,667
License
MIT
Repository
github
Last release
10 years ago

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