I\'m having a bit of a mongo issue. I was wondering if there was a way to do the following in a mongo console command rather then multiple find and update
find
update
You can use the $ positional operator to do this:
db.soup.update( {_id: ObjectId("50b429ba0e27b508d854483e"), 'array.id': '2'}, {$set: {'array.$.letter': 'c'}})
The $ in the update object acts as a placeholder for the first element of array to match the query selector.
$
array