Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoCollection::remove parameters changed in version 1.3 #4

Open
lsnider opened this issue Oct 30, 2013 · 0 comments
Open

MongoCollection::remove parameters changed in version 1.3 #4

lsnider opened this issue Oct 30, 2013 · 0 comments

Comments

@lsnider
Copy link

lsnider commented Oct 30, 2013

http://us1.php.net/manual/en/mongocollection.remove.php mentions the second parameter can longer be set to a boolean. Rather, an array needs to be passed. Attached is the diff to fix it.


diff --git a/classes/document.php b/classes/document.php
index 77b76fd..5193265 100644
--- a/classes/document.php
+++ b/classes/document.php
@@ -1169,7 +1169,7 @@ abstract class Document {
     $this->before_delete();
     $criteria = array('_id' => $this->_object['_id']);
 
-    if( ! $this->collection()->remove($criteria, TRUE))
+    if( ! $this->collection()->remove($criteria,  array('justOne' => true)))
     {
       throw new \MongoException('Failed to delete '.get_class($this));
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant