These are chat archives for Automattic/mongoose

3rd
Mar 2017
webdev48
@webdev48
Mar 03 2017 10:37
Hi folks...does anyone know why my $inc isn't working?
hideStory: function (storyID,callback) {
        var query = {
            _id:storyID
        };


        var updateCommand = {};
        updateCommand['$inc'] = {};
        updateCommand['$inc']['test'] = 1;
        console.log('hideStory : story service : ',updateCommand);

        Story.update(query,updateCommand,callback);

    }
Miguel Dorta
@ellipticaldoor
Mar 03 2017 14:07
how I can generate a mongoose schema from an existing collection