christkv/node-mongodb-native — Issue #397: unable to use $inc with dynamic values
Author: ragefuljoe
Created: 2011-11-08 18:24:22+00:00
State: open

I'm trying to use upserts with dynamic key:value pairs. However I can't seem to get the $inc call to use variables..it just uses whatever I put there.

example:
collection.update( {_id:id}, { '$inc' : { name : 1 } } , {upsert:true} );

What I want is to dynamically add or increment names in the given doc.