Open SamuelSmets opened 1 year ago
Hi, as far as I can tell, value of "_id" in "$group" stage can be valid expression and any literal will lead to single output document. I didn't found any mentions of "expression arrays" in the Docs, only "expression objects". I suspect you have working, but undocumented example and should just use supported expression object (not list). Can you point to docs where interaction with arrays is described?
Also, I think this issue should be addressed to mongomock (as aggregations and stages are implemented there).
Hi,
So far, the use of the AsyncMongoMockClient has been great, but sadly I just ran into an issue in which the expected behaviour is not observed. It has to do with the aggregate method that you can call on a collection (and more specifically the $group functionally).
method to be tested:
Test case:
The expected output of the method under testing is:
The test fails and says that the output should be:
Nevertheless if I use the code on a real mongodb instance, the output is as I formulated in the expected variable. So the matching of "id_dataset" works and the summation and multiplication works, but the group by on columns "col_a" and "col_b" does not work.