Fixed PHP-1084: collection->update($query, $document) crashes if $document is an object

...nt is an object