Folks,
I am trying to use the $rename
operator (http://docs.mongodb.org/manual/reference/operator/update/rename/)
works:
collection.update( {_id: id}, {$rename: {'foo': 'bar'} } , function (err, result) {});
does not:
var this = 'foo';
var that = 'bar';
collection.update( {_id: id}, {$rename: {this: that} } , function (err, result) {});
Why am I not allowed to use variables in the mongoclient to specify things?
Thanks