ddtrace/contrib/pymongo/parse.py
def parse_query(query):
    """ Return a command parsed from the given mongo db query. """
    db, coll = None, None
    ns = getattr(query, "ns", None)
    if ns:
        # version < 3.1 stores the full namespace
        db, coll = _split_namespace(ns)
    else:
        # version >= 3.1 stores the db and coll seperately
        coll = getattr(query, "coll", None)
        db = getattr(query, "db", None)

    # FIXME[matt] mongo < 3.1 _Query doesn't not have a name field,
    # so hardcode to query.
    cmd = Command("query", db, coll)
    cmd.query = query.spec
    return cmd
 Return a command parsed from the given mongo db query. 
Return a command parsed from the given mongo db query.
Return a command parsed from the given mongo db query .
def parse_query(query):
    db, coll = None, None
    ns = getattr(query, "ns", None)
    if ns:
        db, coll = _split_namespace(ns)
    else:
        coll = getattr(query, "coll", None)
        db = getattr(query, "db", None)
    cmd = Command("query", db, coll)
    cmd.query = query.spec
    return cmd
def parse_query ( query ) : db , coll = None , None ns = getattr ( query , "ns" , None ) if ns : db , coll = _split_namespace ( ns ) else : coll = getattr ( query , "coll" , None ) db = getattr ( query , "db" , None ) cmd = Command ( "query" , db , coll ) cmd . query = query . spec return cmd
Return a command parsed from the given mongo db query.
Return a command parsed from the given mongo db query .
""" Return a command parsed from the given mongo db query. """ # version < 3.1 stores the full namespace # version >= 3.1 stores the db and coll seperately # FIXME[matt] mongo < 3.1 _Query doesn't not have a name field, # so hardcode to query.
query