0.0.1 • Published 10 years ago
mongo-key-escape v0.0.1
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
0.0.1
10 years ago