本文整理汇总了Python中pymongo.version方法的典型用法代码示例。如果您正苦于以下问题:Python pymongo.version方法的具体用法?Python pymongo.version怎么用?Python pymongo.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymongo
的用法示例。
在下文中一共展示了pymongo.version方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_compatibility
# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def check_compatibility(module, client):
srv_info = client.server_info()
if LooseVersion(PyMongoVersion) <= LooseVersion('3.2'):
module.fail_json(msg='Note: you must use pymongo 3.2+')
if LooseVersion(srv_info['version']) >= LooseVersion('3.4') and LooseVersion(PyMongoVersion) <= LooseVersion('3.4'):
module.fail_json(msg='Note: you must use pymongo 3.4+ with MongoDB 3.4.x')
if LooseVersion(srv_info['version']) >= LooseVersion('3.6') and LooseVersion(PyMongoVersion) <= LooseVersion('3.6'):
module.fail_json(msg='Note: you must use pymongo 3.6+ with MongoDB 3.6.x')
示例2: get_summary
# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def get_summary(self):
"""
Return a dictionary of information about this database backend.
"""
summary = super().get_summary()
summary.update({
_("Database version"): version,
})
return summary
示例3: check_dependencies
# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def check_dependencies(self):
try:
import nose
self.logger.debug("\tNose: %s\n" % str(nose.__version__))
except ImportError:
raise ImportError("Nose cannot be imported. Are you sure it's "
"installed?")
try:
import networkx
self.logger.debug("\tnetworkx: %s\n" % str(networkx.__version__))
except ImportError:
raise ImportError("Networkx cannot be imported. Are you sure it's "
"installed?")
try:
import pymongo
self.logger.debug("\tpymongo: %s\n" % str(pymongo.version))
from bson.objectid import ObjectId
except ImportError:
raise ImportError("Pymongo cannot be imported. Are you sure it's"
" installed?")
try:
import numpy
self.logger.debug("\tnumpy: %s" % str(numpy.__version__))
except ImportError:
raise ImportError("Numpy cannot be imported. Are you sure that it's"
" installed?")
try:
import scipy
self.logger.debug("\tscipy: %s" % str(scipy.__version__))
except ImportError:
raise ImportError("Scipy cannot be imported. Are you sure that it's"
" installed?")
示例4: get_library_versions
# 需要导入模块: import pymongo [as 别名]
# 或者: from pymongo import version [as 别名]
def get_library_versions(cls):
return {'pymongo': pymongo.version}