Skip to content

Commit eb2c88f

Browse files
committed
CDRIVER-4010 document let option for aggregate command
1 parent 0161abc commit eb2c88f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

build/generate-opts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def __init__(self, items, **defaults):
321321
collation_option,
322322
server_option,
323323
('batchSize', {'type': 'int32_t', 'help': 'An ``int32`` representing number of documents requested to be returned on each call to :symbol:`mongoc_cursor_next`', 'check_set': True}),
324-
('let', {'type': 'bson_t', 'help': 'A BSON document consisting of any number of parameter names, each followed by definitions of constants in the MQL Aggregate Expression language'})
324+
('let', {'type': 'document', 'help': 'A BSON document consisting of any number of parameter names, each followed by definitions of constants in the MQL Aggregate Expression language'})
325325
])),
326326

327327
('mongoc_find_and_modify_appended_opts_t', Struct([

src/libmongoc/src/mongoc/mongoc-opts.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ _mongoc_aggregate_opts_parse (
18851885
mongoc_aggregate_opts->serverId = 0;
18861886
mongoc_aggregate_opts->batchSize = 0;
18871887
mongoc_aggregate_opts->batchSize_is_set = false;
1888-
mongoc_aggregate_opts->let = NULL;
1888+
bson_init (&mongoc_aggregate_opts->let);
18891889
bson_init (&mongoc_aggregate_opts->extra);
18901890

18911891
if (!opts) {
@@ -1969,7 +1969,7 @@ _mongoc_aggregate_opts_parse (
19691969
mongoc_aggregate_opts->batchSize_is_set = true;
19701970
}
19711971
else if (!strcmp (bson_iter_key (&iter), "let")) {
1972-
if (!_mongoc_convert_bson_t (
1972+
if (!_mongoc_convert_document (
19731973
client,
19741974
&iter,
19751975
&mongoc_aggregate_opts->let,
@@ -2003,6 +2003,7 @@ _mongoc_aggregate_opts_cleanup (mongoc_aggregate_opts_t *mongoc_aggregate_opts)
20032003
mongoc_write_concern_destroy (mongoc_aggregate_opts->writeConcern);
20042004
}
20052005
bson_destroy (&mongoc_aggregate_opts->collation);
2006+
bson_destroy (&mongoc_aggregate_opts->let);
20062007
bson_destroy (&mongoc_aggregate_opts->extra);
20072008
}
20082009

0 commit comments

Comments
 (0)