Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0BETA1
-
Fix Version/s: 1.0.0BETA2
-
Component/s: Document Manager
-
Labels:None
-
Environment:Windows xp sp3, apache
Description
Boolean true is returned instead of an object after a FindAndModify command is successfully executed.
$c = $dm->createQuery('downloads')
->findAndModify(array('new' => true))
>field('key')>equals('file1')
->update()
>field('counter')>inc(1)
->execute();
echo gettype($c); // boolean
The syntax using the latest version of mongodb odm in git is:
$c = $dm->createQuery('downloads') ->findAndUpdate() ->returnNew() ->field('key')->equals('file1') ->field('counter')>inc(1) ->execute();