classafMongo::MongoCmd

sys::Obj
  afMongo::MongoCmd

The principle class that communicates with MongoDB.

add

Source

This add(Str key, Obj? val)

Adds the given val - but only if it does not aleady exist in the cmd.

If val is null, it is not added.

Use to chain add() methods.

addAll

Source

This addAll([Str:Obj?]? all)

Adds all the given vals - but only if they don't already exist in the cmd.

If all is null, it is not added.

Use to chain add() methods.

cmd

Source

Str:Obj? cmd { private set }

The backing cmd document.

cmdName

Source

const Str cmdName

The name of this cmd.

cmdVal

Source

const Obj? cmdVal

The value of this cmd.

connMgr

Source

const MongoConnMgr connMgr

The connection manager that Mongo connections are leased from.

containsKey

Source

Bool containsKey(Str key)

Returns true if this cmd contains the given key.

cursor

Source

MongoCur cursor()

Executes this cmd on the MongoDB server, and preemptively interprets the response as a cursor.

dbName

Source

const Str dbName

The name of the database.

get

Source

@Operator
Obj? get(Str key)

Returns a value from the cmd.

make

Source

new make(MongoConnMgr connMgr, Str dbName, Str cmdName, Obj? cmdVal := 1, Obj? session := null)

Creates a new MongoCmd.

run

Source

Str:Obj? run(Bool checked := true)

Executes this cmd on the MongoDB server, and returns the response as a BSON document.

set

Source

@Operator
This set(Str key, Obj? val)

Sets a value in the cmd.

trap

Source

virtual override Obj? trap(Str name, Obj?[]? args := null)

Trap operator for get() and add().