Skip to content

txmongo list of collections not returned #209

@ashishRay12

Description

@ashishRay12

txmongo dosen't return list of all collections.Inserts and deletes works just fine.Below is the code that is being used.


from txmongo.connection import ConnectionPool
from twisted.internet import defer, reactor
import time


@defer.inlineCallbacks
def mongoHost():
    mongodb_uri = "mongodb://%s:%s" % ('127.0.0.1', '27017')
    mongo = yield ConnectionPool(mongodb_uri)
    defer.returnValue(mongo)


@defer.inlineCallbacks
def query_to_db():
    mongo = yield mongoHost()
    db = mongo['clients']
    coll = yield db.collection_names() # <------------------dosen't works!
    # coll = yield db.facebook.find({})  <------------------works !
    print coll

if __name__ == '__main__':
    reactor.callLater(1, query_to_db)
    reactor.run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions