00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 """Python driver for MongoDB."""
00016
00017 from pymongo.connection import Connection as PyMongo_Connection
00018
00019 ASCENDING = 1
00020 """Ascending sort order."""
00021 DESCENDING = -1
00022 """Descending sort order."""
00023
00024 GEO2D = "2d"
00025 """Index specifier for a 2-dimensional `geospatial index`_.
00026
00027 .. versionadded:: 1.5.1
00028
00029 .. note:: Geo-spatial indexing requires server version **>= 1.3.3+**.
00030
00031 .. _geospatial index: http://www.mongodb.org/display/DOCS/Geospatial+Indexing
00032 """
00033
00034 OFF = 0
00035 """No database profiling."""
00036 SLOW_ONLY = 1
00037 """Only profile slow operations."""
00038 ALL = 2
00039 """Profile all operations."""
00040
00041
00042 version = "1.10"
00043 """Current version of PyMongo."""
00044
00045 Connection = PyMongo_Connection
00046 """Alias for :class:`pymongo.connection.Connection`."""
00047
00048
00049 def has_c():
00050 """Is the C extension installed?
00051
00052 .. versionadded:: 1.5
00053 """
00054 try:
00055 from pymongo import _cmessage
00056 return True
00057 except ImportError:
00058 return False