txmongo package¶
Submodules¶
txmongo.collection module¶
-
class
txmongo.collection.
Collection
(database, name)[source]¶ Bases:
object
-
find_with_cursor
(spec=None, skip=0, limit=0, fields=None, filter=None, **kwargs)[source]¶ find method that uses the cursor to only return a block of results at a time. Arguments are the same as with find() returns deferred that results in a tuple: (docs, deferred) where docs are the current page of results and deferred results in the next tuple. When the cursor is exhausted, it will return the tuple ([], None)
-
txmongo.connection module¶
-
class
txmongo.connection.
ConnectionPool
(uri='mongodb://127.0.0.1:27017', pool_size=1, ssl_context_factory=None)[source]¶ Bases:
object
-
uri
¶
-
-
txmongo.connection.
MongoConnectionPool
¶ alias of
MongoConnection
-
txmongo.connection.
lazyMongoConnection
¶ alias of
MongoConnection
-
txmongo.connection.
lazyMongoConnectionPool
¶ alias of
MongoConnection
txmongo.database module¶
txmongo.dbref module¶
Tools for manipulating DBRefs (references to MongoDB documents).
-
class
txmongo.dbref.
DBRef
(collection, id, database=None)[source]¶ Bases:
object
A reference to a document stored in a Mongo database.
-
as_doc
()[source]¶ Get the SON document representation of this DBRef.
Generally not needed by application developers
-
collection
¶ Get the name of this DBRef’s collection as unicode.
-
database
¶ Get the name of this DBRef’s database.
Returns None if this DBRef doesn’t specify a database.
New in version 1.1.1.
-
id
¶ Get this DBRef’s _id.
-
txmongo.filter module¶
-
txmongo.filter.
GEO2D
(keys)[source]¶ Two-dimensional geospatial index http://www.mongodb.org/display/DOCS/Geospatial+Indexing
-
txmongo.filter.
GEO2DSPHERE
(keys)[source]¶ Two-dimensional geospatial index http://www.mongodb.org/display/DOCS/Geospatial+Indexing
-
txmongo.filter.
GEOHAYSTACK
(keys)[source]¶ Bucket-based geospatial index http://www.mongodb.org/display/DOCS/Geospatial+Haystack+Indexing
-
class
txmongo.filter.
explain
[source]¶ Bases:
txmongo.filter._QueryFilter
Returns an explain plan for the query.
txmongo.gridfs module¶
txmongo.protocol module¶
Low level connection to Mongo.
This module contains the wire protocol implementation for txmongo. The various constants from the protocol are available as constants.
This implementation requires pymongo so that as much of the implementation can be shared. This includes BSON encoding and decoding as well as Exception types, when applicable.
-
class
txmongo.protocol.
Delete
[source]¶ Bases:
txmongo.protocol.Delete
-
class
txmongo.protocol.
Getmore
[source]¶ Bases:
txmongo.protocol.Getmore
-
class
txmongo.protocol.
Insert
[source]¶ Bases:
txmongo.protocol.Insert
-
class
txmongo.protocol.
KillCursors
[source]¶ Bases:
txmongo.protocol.KillCursors
-
class
txmongo.protocol.
MongoProtocol
[source]¶ Bases:
txmongo.protocol.MongoServerProtocol
,txmongo.protocol.MongoClientProtocol
-
connectionLost
(reason=<twisted.python.failure.Failure <class 'twisted.internet.error.ConnectionDone'>>)[source]¶
-
max_wire_version
= None¶
-
min_wire_version
= None¶
-
-
class
txmongo.protocol.
Msg
(len, request_id, response_to, opcode, message)¶ Bases:
tuple
-
len
¶ Alias for field number 0
-
message
¶ Alias for field number 4
-
opcode
¶ Alias for field number 3
-
request_id
¶ Alias for field number 1
-
response_to
¶ Alias for field number 2
-
-
class
txmongo.protocol.
Query
[source]¶ Bases:
txmongo.protocol.Query
-
class
txmongo.protocol.
Reply
[source]¶ Bases:
txmongo.protocol.Reply
-
class
txmongo.protocol.
Update
[source]¶ Bases:
txmongo.protocol.Update