note 99522 deleted from mongo.updates by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Sep 2010 21:33:53 +0000 |
| Subject: | note 99522 deleted from mongo.updates by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172615@lists.php.net to get a copy of this message | ||
Note Submitter: Remi Woler
----
If you queried for a record before, updating that same record is not so difficult. Just remember the
_id (of type MongoId) and use:
<?php
$blog->update(
array('_id'=> $id), //$id is the stored _id, and of type MongoId
array('$set' => array('comments.$.author' => "Jim"))
);
?>