classafMongo::Operation
sys::Obj afMongo::Operation
(Advanced) The low level transport mechanism that talks to MongoDB instances.
This is, actually, the only class you need to talk to a MongoDB instance! All other classes merely wrap calls to this.
This class, and the BSON reader / writer classes, have been optomised for memory efficiency. Feel free to send your 16Mb+ documents to MongoDB for they'll be streamed straight out over the socket.
@see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/
- getMore
OpReplyResponse getMore(Str qname, Int limit, Int cursorId)
Asks MongoDB for more documents from a query.
@see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-get-more
- killCursors
Void killCursors(Int[] cursorIds)
Closes the given active cursors in the database.
@see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-kill-cursors
- make
new make(Connection connection)
Creates an
Operation
with the given connection.- query
OpReplyResponse query(Str qname, Str:Obj? query, Int limit := 0, Int skip := 0, [Str:Obj?]? fields := null, OpQueryFlags flags := OpQueryFlags.none)
Queries MongoDB for documents in a collection.
@see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
- readReply
OpReplyResponse readReply(Int? requestId)
Reads a reply from the server.
requestId
may benull
when gulping down replies resulting from an exhaust query.- runCommand
Str:Obj? runCommand(Str qname, Str:Obj? cmd, Bool checked := true)
Runs the given Mongo command and returns the reply document.