Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:08:04+00:00 2026-05-29T09:08:04+00:00

I try to delete document in mongodb using php, I it fails and I

  • 0

I try to delete document in mongodb using php, I it fails and I get a waring:

Warning: MongoCollection::remove() expects parameter 2 to be boolean, array given

$mongo = new Mongo();
$db = $mongo->test; 
$collection = $db->subscribers;
$collection->remove(array( 'LISTID' => 49));

Could you please tell me what causes an error?
I phpinfo() shows:

mongo
MongoDB Support enabled
Version     1.0.4+

Directive   Local Value Master Value
mongo.allow_persistent  On  On
mongo.auto_reconnect    On  On
mongo.chunk_size    262144  262144
mongo.cmd   $   $
mongo.default_host  localhost   localhost
mongo.default_port  27017   27017
mongo.utf8  1   1

It’s strange, the documentation say the function looks like:

public mixed MongoCollection::remove ( array $criteria [, array $options = array() ] )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:08:05+00:00Added an answer on May 29, 2026 at 9:08 am

    You appear to be using a very old version. From the manual

    1.0.5 Changed second parameter to an array of options. Pre-1.0.5, the second parameter was a boolean indicating the “justOne” option and there was no safe option.

    Either upgrade or change your code to

    $collection->remove(array('LISTID' => 49), false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php page where I add and delete items from database using
Through CommandName=Delete I try to delete a line from the ListView control but not
I'm looking to try to make an efficient delete method to work on a
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try as I might I cannot get my head around what the IteratorIterator class
Try as I might, I can't get a JNLP file to run locally (via
I'm trying to delete a worksheet from a excel document from a .Net c#
When I try and build my project I get the following errors: 1>Assignment1CoreTest.obj :
function showContent(tableID) { var tbl = document.getElementById(tableID); var rCount = tbl.rows.length; try { alert(tbl.rows[rCount
How can i import javascript in php? No matter what i try, i can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.