passing options to aggregate

Create issue
Issue #14 new
Torsten Scholak created an issue

I had a look at the code, and atm it doesn't seem possible to pass options like "allowDiskUse" to mongodb. I wonder, will this feature be implemented?

Comments (2)

  1. Torsten Scholak reporter

    As a very quick&dirty hack, I changed line 980 in monary/cmonary.c to

    bson_t opts;
    BSON_APPEND_BOOL (&opts, "allowDiskUse", true);
    mcursor = mongoc_collection_aggregate(collection,
                                          &pl_bson, &opts, NULL);
  2. A. Jesse Jiryu Davis

    Good point, thanks for filing the report. I think the Python "aggregate" function should take **kwargs and BSON-encode the kwargs dict to "opts". That will permit "allowDiskUse" and any future options that are added to "aggregate".

  3. Log in to comment