alexbilbie/codeigniter-mongodb-library — Issue #36: Update and update_all response to something useable
Author: kuseattle
Created: 2012-01-23 17:47:24+00:00
State: open

I have a lot of conditions based on wether an update actually happened, so when updates return TRUE regardless there is really nothing to check for. I have always changed the current version of this library to check the mongo value of updatedExisting, and return the update count or false. So on 'update' and 'update_all' I have changed:

return (TRUE);

to this:

// return result
if ($result['updatedExisting'] > 0) return $result['updatedExisting'];
return FALSE;