vibe.db.mongo.connection
Low level mongodb protocol.
Copyright
Types 19
string messageint codeint connectionIdint ndouble okD POD representation of Mongo error object.
For successful queries "code" is negative. Can be used also to check how many documents where updated upon a successful query via "n" field.
Root class for vibe.d Mongo driver exception hierarchy.
this(string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null)Generic class for all exception related to unhandled driver problems.
I.e.: protocol mismatch or unexpected mongo service behavior.
this(string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null)Wrapper class for all inner mongo collection manipulation errors.
It does not indicate problem with vibe.d driver itself. Most frequently this one is thrown when MongoConnection is in checked mode and getLastError() has something interesting.
MongoErrorDescription descriptionthis(MongoErrorDescription description, string file = __FILE__,
size_t line = __LINE__, Throwable next = null)Generic class for all exceptions related to authentication problems.
I.e.: unsupported mechanisms or wrong credentials.
this(string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null)[internal] Provides low-level mongodb protocol access.
It is not intended for direct usage. Please use vibe.db.mongo.db and vibe.db.mongo.collection modules for your code. Note that a MongoConnection may only be used from one fiber/thread at a time.
private MongoClientSettings m_settingsprivate TCPConnection m_connprivate InterfaceProxy!Stream m_streamprivate ulong m_bytesReadprivate int m_msgidprivate StreamOutputRange!(InterfaceProxy!Stream) m_outRangeprivate ServerDescription m_descriptionprivate bool m_allowReconnectFlag to prevent recursive connections when server closes connection while connectingprivate bool m_isAuthenticatingprivate bool m_supportsOpMsgushort defaultPortvoid connect() @safevoid disconnect() @safevoid update(string collection_name, UpdateFlags flags, Bson selector, Bson update) @safevoid insert(string collection_name, InsertFlags flags, Bson[] documents) @safevoid query(T)(string collection_name, QueryFlags flags, int nskip, int nret, Bson query, Bson returnFieldSelector, scope ReplyDelegate on_msg, scope DocDelegate!T on_doc) @safeBson runCommand(T, CommandFailException = MongoDriverException)(
string database,
Bson command,
string errorInfo = __FUNCTION__,
string errorFile = __FILE__,
size_t errorLine = __LINE__
) @safeRuns the given Bson command (Bson object with the first entry in the map being the command name) on the given database.Bson runCommandUnchecked(T, CommandFailException = MongoDriverException)(
string database,
Bson command,
string errorInfo = __FUNCTION__,
string errorFile = __FILE__,
size_t errorLine = __LINE__
) @safeBson runCommandImpl(T, CommandFailException)(
string database,
Bson command,
bool testOk = true,
string errorInfo = __FUNCTION__,
string errorFile = __FILE__,
size_t errorLine = __LINE__
) @safevoid startFind(T)(Bson command,
scope GetMoreHeaderDelegate on_header,
scope GetMoreDocumentDelegate!T on_doc,
string batchKey = "firstBatch",
string errorInfo = __FUNCTION__, string errorFile = __FILE__, size_t errorLine = __LINE__) @safeForwards the `find` command passed in to the database, handles the callbacks like with getMore. This exists for easier integration with MongoCursor!T.void delete_(string collection_name, DeleteFlags flags, Bson selector) @safevoid killCursors(scope long[] cursors) @safevoid killCursors(string collection, scope long[] cursors) @safeMongoErrorDescription getLastError(string db) @safeint recvMsg(bool dupBson = true)(int reqid,
scope MsgReplyDelegate!dupBson on_sec0,
scope MsgSection1StartDelegate on_sec1_start,
scope MsgSection1Delegate!dupBson on_sec1_doc) @safethis(string server, ushort port = defaultPort)Simplified constructor overload, with no m_settingsthis(MongoClientSettings cfg)getMore(T)string namedouble sizeOnDiskbool emptystring addressstring errorfloat roundTripTimeNullable!BsonDate lastWriteDateNullable!BsonObjectID opTimeServerType typeint minWireVersionstring mestring[] hostsstring[string] tagsstring setNameNullable!int setVersionNullable!BsonObjectID electionIdstring primarystring lastUpdateTimeNullable!int logicalSessionTimeoutMinutesServerTypeVariables 1
hostArchitecture = getHostArchitecture