qmmap.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:qmmap 作者: hiqlabs 项目源码 文件源码
def connectMongoEngine(pmcol, conn_uri=None):
    if pymongo.version_tuple[0] == 2:     #really? REALLY?
        #host = pmcol.database.connection.HOST
        #port = pmcol.database.connection.PORT
        host = pmcol.database.connection.host
        port = pmcol.database.connection.port
    else:
        host = pmcol.database.client.HOST
        port = pmcol.database.client.PORT
    # Can just use the connection uri, which has credentials
    if conn_uri:
        return meng.connect(pmcol.database.name, host=conn_uri)
    return meng.connect(pmcol.database.name, host=host, port=port)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号