What you're asking for is basically a feature for triggers (some
fields gets updated automatically on every update/insert). MongoDB
does not have any support for triggers. What you could do is to
override the beforeSave method in EMongoDocument, and implement your
"triggers" there, in php. Don't forget to call the parent
implementation so that events gets fired. For example:
class MyDoc extends EMongoDocument {
public $updated;
public function beforeSave() {
parent::beforeSave();
$this->updated = time();
}
}
--
Nagy Attila Gabor
$this->updated = new MongoDate();