Normally Palatable Mango

    mongoobject

    2.0.0 • Public • Published

    mongoobject

    escapes $ and . in object keys so you can store objects in MongoDB.

    Installation

    npm install mongoobject
    

    Usage

    var mongoobject = require('mongoobject');
     
    var objectToSaveInMongo = mongoobject.escape(myObject);
    var mongoobject = require('mongoobject');
     
    var myObject = mongoobject.unescape(myObjectFromMongo);
     

    You can also escape and unescape just one property name

    var escapedPropertyName = mongoobject.escapeKey('$mypropertyName');
     
    var unescapedPropertyName = momgoobject.unescapeKey('\uff04myPropertyName');

    License

    MIT

    Install

    npm i mongoobject

    DownloadsWeekly Downloads

    81

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • fizker
    • jonatanpedersen
    • mpushkin
    • ebdrup
    • bubenshchykov
    • eagleeye
    • kapetan
    • wtfil
    • bifrost