[CDRIVER-3249] Document how to use mongoc_collection_aggregate with an "array" Created: 16/Jul/19  Updated: 31/Mar/22

Status: Backlog
Project: C Driver
Component/s: docs, libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

mongoc_collection_aggregate documents:

pipeline: A bson_t, either a BSON array or a BSON document containing an array field named “pipeline”.

Constructing a BSON "array" requires constructing a BSON document with keys "0", "1", "2", ...

I think it's worth adding to the examples on that page an example of using this form pipeline, e.g. with:

pipeline = BCON_NEW ("[", "{", "$match", "{" "foo", BCON_UTF8("a"), "}", "}", "]");


Generated at Wed Feb 07 21:17:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.