0.0.4 • Published 9 years ago

mongo-object-escape v0.0.4

Weekly downloads
10
License
ISC
Repository
-
Last release
9 years ago

mongo-object-escape

Mongo cannot store documents that have '$' or '.' in keys.

The docs encourage replacing with the Unicode full-width equivalents U+FF04 (i.e. “$”) and U+FF0E (i.e. “.”).

This library escapes and unescapes the keys of an object according to that convention, returning a new object from each.

See the tests for examples.

API

var mongoObject = require('mongo-object-escape');
var escapedDocToWrite = mongoObject.escape(userInput);
var unescapedDocToRead = mongoObject.unescape(escapedDocToWrite);
0.0.4

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago