mongo-key-escape

0.0.1 • Public • Published

mongo-key-escape

Escape MongoDB keys for characters . and $.

Installation

$ npm install mongo-key-escape

Example

var key = require('mongo-key-escape');
 
key.escape('event.thing');
// event\uFF0Ething
key.unescape('event\uFF0Ething');
// 'event.thing'
 
key.escape('event$thing');
// event\uFF04thing
key.unescape('event\uFF04thing');
// 'event$thing'

License

MIT

Package Sidebar

Install

npm i mongo-key-escape

Weekly Downloads

399

Version

0.0.1

License

MIT

Last publish

Collaborators

  • ivolo