FAQ
Hi,

I'm having trouble getting a simple async coroutine working with
tornado/motor:

@gen.coroutine
def find_by_id(db_async, group_id):
     '''Get group by id'''
     query = {
         '_id': group_id,
     }
     yield motor.Op(db_async.groups.find_one(query))


2013-08-30T18:51:49.985048+00:00 app[web.1]: File
"/app/addv-api/models/groups.py", line 74, in find_by_id
2013-08-30T18:51:49.985048+00:00 app[web.1]: yield
motor.Op(db_async.groups.find_one(query))
2013-08-30T18:51:49.985048+00:00 app[web.1]: TypeError: 'MotorCollection'
object is not callable

Any help with this would be greatly appreciated!

Cheers!

David

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user+unsubscribe@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • A. Jesse Jiryu Davis at Aug 30, 2013 at 8:02 pm
    Answered here:

    https://groups.google.com/d/msg/python-tornado/kWTMCETq9Gg/IiQKNR5nwf4J
    On Friday, August 30, 2013 2:58:24 PM UTC-4, David Stainton wrote:



    Hi,

    I'm having trouble getting a simple async coroutine working with
    tornado/motor:

    @gen.coroutine
    def find_by_id(db_async, group_id):
    '''Get group by id'''
    query = {
    '_id': group_id,
    }
    yield motor.Op(db_async.groups.find_one(query))


    2013-08-30T18:51:49.985048+00:00 app[web.1]: File
    "/app/addv-api/models/groups.py", line 74, in find_by_id
    2013-08-30T18:51:49.985048+00:00 app[web.1]: yield
    motor.Op(db_async.groups.find_one(query))
    2013-08-30T18:51:49.985048+00:00 app[web.1]: TypeError: 'MotorCollection'
    object is not callable

    Any help with this would be greatly appreciated!

    Cheers!

    David
    --
    --
    You received this message because you are subscribed to the Google
    Groups "mongodb-user" group.
    To post to this group, send email to mongodb-user@googlegroups.com
    To unsubscribe from this group, send email to
    mongodb-user+unsubscribe@googlegroups.com
    See also the IRC channel -- freenode.net#mongodb

    ---
    You received this message because you are subscribed to the Google Groups "mongodb-user" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmongodb-user @
categoriesmongodb
postedAug 30, '13 at 7:27p
activeAug 30, '13 at 8:02p
posts2
users2
websitemongodb.org
irc#mongodb

People

Translate

site design / logo © 2022 Grokbase