I am using the ObjCMongoDB library to back a simple iPad application. I understand the basic CRUD operations as well as use of -[MongoConnection runCommandWithDictionary:onDatabaseName:error:]
to execute database commands such as findAndModify
.
With respect to the Aggregation Framework or just aggregation in general, it looks like I can execute simple database commands like count
in the following manner:
NSDictionary *commandDict = @{@"count": @"myCollection"}:
[myMongoConnection runCommandWithDictionary:commandDict onDatabaseName:@"myDB" error:&err];
Is it possible to execute more complex commands/queries like the examples here? I tried the following to no avail.
NSDictionary *commandDict = @{@"aggregate":@"myCollection", @"query": @{@"group":@"myDocType"}};
Am still learning both Obj-C as well as MongoDB so apologies if this is an uninformed question.