mongoqueue
mongoqueue copied to clipboard
'Collection' object is not callable
>>> queue = MongoQueue(Connection('localhost').doctest_queue, consumer_id='consumer-1', timeout=300, max_attempts=3)
>>> queue.put({"foobar": 1})
TypeError: 'Collection' object is not callable. If you meant to call the 'insert' method on a 'Database' object it is failing because no such method exists.
You should use MongoClient instead of Connection
Try this:
db = pymongo.MongoClient('localhost',27017) queue = MongoQueue(db.local.doctest_queue,consumer_id='test',timeout=300,max_attempts=3) queue.put({"foo":1})
Thanks, was using example from README.
Also I noticed you used timedelta(self.timeout). You probably want timedelta(seconds=self.timeout) because the default first argument is days.
+1 @richardpenman I just ran into this myself.. too bad this project seems to died