JSPM

mongo-json-escape

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 124
  • Score
    100M100P100Q67341F
  • License MIT

Escape MongoDB reserved characters $ and . from JSON objects

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