|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63001 MongoCollection::insert() doesn't take `true` for safe insert
Submitted: 2012-09-02 21:52 UTC Modified: 2013-07-14 19:38 UTC
From: jeremy dot benoist at gmail dot com Assigned: derick (profile)
Status: Closed Package: mongo (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jeremy dot benoist at gmail dot com
New email:
PHP Version: OS:


 [2012-09-02 21:52 UTC] jeremy dot benoist at gmail dot com
From manual page:

As described in the revision log:

> The options parameter does no longer accept just a boolean to signify a safe 
insert. Instead, this now has to be done with array('safe' => true).

The example (on both code part) of the page display the second argument as a 
boolean instead of an array:

> $collection->insert($person, true);

Should be 

> $collection->insert($person, array('safe' => true));

Expected result:
$collection->insert($person, array('safe' => true));

Actual result:
$collection->insert($person, true);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-08 16:09 UTC]
-Package: Unknown/Other Function +Package: mongo
 [2012-09-08 16:09 UTC]
change package
 [2013-07-14 19:38 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: derick
 [2013-07-14 19:38 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 08 17:02:33 2021 UTC