I have a simple structure in mongodb, with nested array. How can I update searched value? I\'ve seen examples using numbers something like this:
invited.0.us
update({ invited.key : 84026702 }, { invited.$.used : true });
This basically does what you wanna and should work nicely. Look into positional operators in mongodb: http://www.mongodb.org/display/DOCS/Updating#Updating-The%24positionaloperator
Or in PHP (as your question is tagged) you can do:
$mongo->collection->update(array('invited.key' => 84026702), array('invited.$.used' => true));