@@ -314,15 +314,6 @@ mongoc_collection_aggregate (mongoc_collection_t *collection, /* IN */
314
314
did_batch_size = true;
315
315
batch_size = (int32_t )bson_iter_as_int64 (& iter );
316
316
BSON_APPEND_INT32 (& child , "batchSize" , batch_size );
317
- } else if (BSON_ITER_IS_KEY (& iter , "allowDiskUse" ) &&
318
- BSON_ITER_HOLDS_BOOL (& iter )) {
319
- BSON_APPEND_BOOL (& child , "allowDiskUse" ,
320
- bson_iter_bool (& iter ));
321
- } else {
322
- /*
323
- * Just pass it through if we don't know what it is.
324
- */
325
- bson_append_iter (& child , bson_iter_key (& iter ), -1 , & iter );
326
317
}
327
318
}
328
319
}
@@ -334,6 +325,14 @@ mongoc_collection_aggregate (mongoc_collection_t *collection, /* IN */
334
325
bson_append_document_end (& command , & child );
335
326
}
336
327
328
+ if (options && bson_iter_init (& iter , options )) {
329
+ while (bson_iter_next (& iter )) {
330
+ if (! (BSON_ITER_IS_KEY (& iter , "batchSize" ) || BSON_ITER_IS_KEY (& iter , "cursor" ))) {
331
+ bson_append_iter (& command , bson_iter_key (& iter ), -1 , & iter );
332
+ }
333
+ }
334
+ }
335
+
337
336
cursor = mongoc_collection_command (collection , flags , 0 , 0 , batch_size ,
338
337
& command , NULL , read_prefs );
339
338
0 commit comments