Aggregation commands (and a Geospatial command)
Ref to Mongo command documentation for better understanding of each API and its return value is BsonDocument. Geospatial command can be found here.
All APIs are async.
Procs
proc aggregate(db: Database[AsyncSocket]; coll: string; pipeline: seq[BsonDocument]; explain = false; diskuse = false; cursor = bson(); maxTimeMS = 0; bypass = false; readConcern = bsonNull(); collation = bsonNull(); hint = bsonNull(); comment = ""; wt = bsonNull(); explainVerbosity = ""): Future[BsonDocument] {....stackTrace: false, raises: [Exception, ValueError], tags: [RootEffect, TimeEffect, WriteIOEffect, ReadIOEffect], forbids: [].}
- Source Edit
proc aggregate(db: Database[Socket]; coll: string; pipeline: seq[BsonDocument]; explain = false; diskuse = false; cursor = bson(); maxTimeMS = 0; bypass = false; readConcern = bsonNull(); collation = bsonNull(); hint = bsonNull(); comment = ""; wt = bsonNull(); explainVerbosity = ""): BsonDocument {....raises: [ValueError, Exception, KeyError, MongoError, IOError, OSError, SnappyError, ZippyError, SslError, TimeoutError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
- Source Edit
proc count(db: Database[AsyncSocket]; coll: string; query = bson(); limit = 0; skip = 0; hint = bsonNull(); readConcern = bsonNull(); collation = bsonNull(); explain = ""): Future[BsonDocument] {. ...stackTrace: false, raises: [Exception, ValueError], tags: [RootEffect, TimeEffect, WriteIOEffect, ReadIOEffect], forbids: [].}
- Source Edit
proc count(db: Database[Socket]; coll: string; query = bson(); limit = 0; skip = 0; hint = bsonNull(); readConcern = bsonNull(); collation = bsonNull(); explain = ""): BsonDocument {....raises: [ KeyError, ValueError, MongoError, IOError, OSError, Exception, SnappyError, ZippyError, SslError, TimeoutError], tags: [WriteIOEffect, ReadIOEffect, RootEffect, TimeEffect], forbids: [].}
- Source Edit
proc `distinct`(db: Database[AsyncSocket]; coll, key: string; query = bson(); readConcern = bsonNull(); collation = bsonNull(); explain = ""): Future[ BsonDocument] {....stackTrace: false, raises: [Exception, ValueError], tags: [ RootEffect, TimeEffect, WriteIOEffect, ReadIOEffect], forbids: [].}
- Source Edit
proc `distinct`(db: Database[Socket]; coll, key: string; query = bson(); readConcern = bsonNull(); collation = bsonNull(); explain = ""): BsonDocument {....raises: [ KeyError, ValueError, MongoError, IOError, OSError, Exception, SnappyError, ZippyError, SslError, TimeoutError], tags: [WriteIOEffect, ReadIOEffect, RootEffect, TimeEffect], forbids: [].}
- Source Edit
proc geoSearch(db: Database[AsyncSocket]; coll: string; search: BsonDocument; near: seq[BsonDocument]; maxDistance = 0; limit = 0; readConcern = bsonNull()): Future[BsonDocument] {. ...stackTrace: false, raises: [Exception, ValueError], tags: [RootEffect, TimeEffect, WriteIOEffect, ReadIOEffect], forbids: [].}
- Source Edit
proc geoSearch(db: Database[Socket]; coll: string; search: BsonDocument; near: seq[BsonDocument]; maxDistance = 0; limit = 0; readConcern = bsonNull()): BsonDocument {....raises: [KeyError, ValueError, MongoError, IOError, OSError, Exception, SnappyError, ZippyError, SslError, TimeoutError], tags: [WriteIOEffect, ReadIOEffect, RootEffect, TimeEffect], forbids: [].}
- Source Edit
proc mapReduce(db: Database[AsyncSocket]; coll: string; map, reduce: BsonJs; out: BsonBase; query = bson(); sort = bsonNull(); limit = 0; finalize = bsonNull(); scope = bsonNull(); jsMode = false; verbose = false; bypass = false; collation = bsonNull(); wt = bsonNull()): Future[BsonDocument] {....stackTrace: false, raises: [Exception, ValueError], tags: [RootEffect, TimeEffect, WriteIOEffect, ReadIOEffect], forbids: [].}
- Source Edit
proc mapReduce(db: Database[Socket]; coll: string; map, reduce: BsonJs; out: BsonBase; query = bson(); sort = bsonNull(); limit = 0; finalize = bsonNull(); scope = bsonNull(); jsMode = false; verbose = false; bypass = false; collation = bsonNull(); wt = bsonNull()): BsonDocument {....raises: [ValueError, Exception, KeyError, MongoError, IOError, OSError, SnappyError, ZippyError, SslError, TimeoutError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect], forbids: [].}
- Source Edit