In v3 we removed MongooseNumber#$inc support because it lead to too
many weird bugs:
http://mongoosejs.com/docs/migration.html#mongoosenumber
If you are still on 2.x the correct usage is:
user.someNumber.$inc()
On Tue, Aug 21, 2012 at 1:44 AM, renatoargh <
renat...@gmail.com> wrote:
> Aaron, I just tried your approach and got the following (from mongoose
> 'debug':true):
>
> Mongoose: users.update({ _id: 5033346c60bc3d9405000001 }) { '$set': {
> someNumber: 3 } } { safe: true }
>
> And the code I used:
>
> module.exports.incrementSomeNumber = function(user, callback){
>
> user.someNumber.$inc;
>
> user.save(function(){ callback(); });
>
> };
>
> Is this the same, I mean, is this an atomic operation - I am afraid its not,
> as I dont see the $inc on my update
>
> Em sexta-feira, 23 de março de 2012 16h24min29s UTC-3, Aaron Heckmann
> escreveu:
> --
> --
>
http://mongoosejs.com
>
http://github.com/learnboost/mongoose
> You received this message because you are subscribed to the Google
> Groups "Mongoose Node.JS ORM" group.
> To post to this group, send email to
mongoo...@googlegroups.com
> To unsubscribe from this group, send email to
>
mongoose-orm...@googlegroups.com
> For more options, visit this group at
>
http://groups.google.com/group/mongoose-orm?hl=en
>
>
>
--
Aaron
@aaronheckmann