All Projects → segmentio → mongo-key-escape

segmentio / mongo-key-escape

Licence: other
Escape MongoDB keys for characters . and $

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].