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

Argument 2 passed to MongoCollection::insert() must be an array #14

Open
domeri opened this issue Mar 26, 2013 · 6 comments
Open

Argument 2 passed to MongoCollection::insert() must be an array #14

domeri opened this issue Mar 26, 2013 · 6 comments

Comments

@domeri
Copy link

domeri commented Mar 26, 2013

Hi. I am getting an error when using insert function.

Catchable fatal error: Argument 2 passed to MongoCollection::insert() must be an array, boolean given, called in E:\xampp\htdocs\Denis\ActiveMongo-master\testing\file1.php on line 22 and defined in E:\xampp\htdocs\Denis\ActiveMongo-master\lib\ActiveMongo.php on line 1179

@crodas
Copy link
Owner

crodas commented Mar 26, 2013

Checking now.

@alanjames1987
Copy link

I'm getting this as well using the blog sample provided.

Catchable fatal error: Argument 2 passed to MongoCollection::insert() must be an array, boolean given, called in /home/adminuser/www/samples/blog/App.php on line 60 and defined in /home/adminuser/www/lib/ActiveMongo.php on line 1179

@dondreytaylor
Copy link

This issue is because the second argument passed to MongoCollection::insert was changed from boolean to an array. To fix this issue change the second parameter to array('w'=>1), where 1 is the boolean passed. Check out this thread:

ichikaway/mongoDB-Datasource#10

@dondreytaylor
Copy link

Codas, your issue is on line 1179 within ActiveMongo, once you change the secondary parameter, everything works as expected.

@alanjames1987
Copy link

Dondreytaylor if you fork the repo, make the change, and submit a pull request Codas will hopefully accept the change and this issue can be solved.

@crodas
Copy link
Owner

crodas commented Mar 18, 2014

I'm going to fix this today

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

4 participants