Oleg
Oleg

Reputation: 2821

can't connect mongodb in python

I can't connect mongodb on server with debian and python 2.6.6 on this line:

connection = pymongo.Connection('mongodb://localhost', safe = True)

TypeError: init() got an unexpected keyword argument 'safe'

The same code works on window machine with python 2.7.3. Could you please explain how to correct this error?

I have pymongo version 2.3 on machine where it works and 1.7 where it doesn't work.

Upvotes: 1

Views: 1373

Answers (2)

user2665694
user2665694

Reputation:

Ensure that both servers have the same pymongo version installed. Likely a version mismatch with slightly different parameter lists for the Connection constructor.

Upvotes: 1

alexvassel
alexvassel

Reputation: 10740

Seems like you are using different versions of pymongo.

Upvotes: 1

Related Questions