Skip to content

Commit

Permalink
Fixed MQL
Browse files Browse the repository at this point in the history
  • Loading branch information
aclark4life committed Nov 15, 2024
1 parent 025026e commit 65b29f9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/raw_query/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,20 +311,23 @@ def test_annotations(self):
{
"$lookup": {
"from": "raw_query_book",
"localField": "id",
"localField": "_id",
"foreignField": "author_id",
"as": "books",
}
},
{"$addFields": {"book_count": {"$size": "$books"}}},
{"$project": {"books": 0}},
{
"$project": {
"first_name": 1,
"last_name": 1,
"dob": 1,
"book_count": {"$size": "$books"},
"$group": {
"_id": "$_id",
"first_name": {"$first": "$first_name"},
"last_name": {"$first": "$last_name"},
"dob": {"$first": "$dob"},
"book_count": {"$first": "$book_count"},
}
},
{"$sort": {"id": 1}},
{"$sort": {"_id": 1}},
]
expected_annotations = (
("book_count", 3),
Expand Down

0 comments on commit 65b29f9

Please sign in to comment.