mongo-key-escape
v0.0.1
Published
Escape mongo keys for periods and dollar signs
Downloads
1,432
Readme
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