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

cmdVal

Source

const Obj? cmdVal

connMgr

Source

const MongoConnMgr connMgr

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

extract

Source

Str:Obj? extract(Str[] keys)

get

Source

@Operator
Obj? get(Str key)

make

Source

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

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)

withFn

Source

This withFn(|MongoCmd? fn)

Like with(), but fn may be null.