Django and Mongodb
Everything works great until I try to use pymongo to connect to the mongo server.
I get the connection, and I can see the database, but when I run the following test I get unicode errors.
>>> import django
>>> import pymongo
>>> connection = pymongo.Connection("localhost", 27017)
>>> db = connection.test
>>> db.name()
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: 'unicode' object is not callable</module></console>
I'm not sure what that means or how to fix it. Does anyone have suggestions?
2 Replies
In [1]: spackle = "wasps"
In [2]: spackle()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/jsmith/ <ipython console="">in <module>()
TypeError: 'str' object is not callable</module></ipython>
Try typing just:
>>> db.name
The documentation for database.name