0.0.1 • Published 10 years ago

mongo-key-escape v0.0.1

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

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