[CDRIVER-2939] Drivers should ignore batchSize=0 for aggregate with $out Created: 30/Jan/19  Updated: 28/Oct/23  Resolved: 28/Feb/19

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.15.0

Type: New Feature Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Clyde Bazile III (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1721 Drivers should ignore batchSize=0 for... Closed
is depended on by DRIVERS-587 Drivers should ignore batchSize=0 for... Closed
Related
related to CDRIVER-2995 Failing aggregate-out unit test with ... Closed

 Description   

See DRIVERS-587 for details.



 Comments   
Comment by Githook User [ 28/Feb/19 ]

Author:

{'name': 'bazile-clyde', 'email': '34226620+bazile-clyde@users.noreply.github.com', 'username': 'bazile-clyde'}

Message: CDRIVER-2939 We should ignore batchSize=0 for agg cmds with $out
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/b213866a96910828ef90a5e3b9f7e0775eeaa78d

Comment by Kevin Albertson [ 14/Feb/19 ]

Here are some ways to approach this ticket:

  • Test aggregate with $out in the shell and see why batchSize=0 is really an issue (as you can tell, I myself don't have a great understanding).
  • Modify example-client.c to try mongoc_collection_aggregate with $out and batch size as options to see how it works in the C driver
  • Make the change in mongoc-collection.c. We already have a _has_out_key to check for specific behavior for $out in a pipeline. That's here.
  • Then, make mock server tests to check that we are not sending batchSize=0 when $out is included, that we are sending it when $out is omitted, and that we are sending batchSize>0 when $out is included.

Here's an example of the mock server we fumbled through together, slightly cleaned up and commented:
https://gist.github.com/kevinAlbs/8c96d2693f0611a0cc267407a67e7774

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