-   Notifications  You must be signed in to change notification settings 
- Fork 30
Closed
Description
e.g. This returns no results:
qs = NullableIntegerArrayModel.objects.filter(order__lt=3) self.assertCountEqual( NullableIntegerArrayModel.objects.filter( field__overlap=qs.values_list("field"), ), )Demonstrated in this test failure:
FAIL: test_overlap_values (model_fields_.test_arrayfield.QueryingTests.test_overlap_values) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tim/code/django-mongodb/tests/model_fields_/test_arrayfield.py", line 394, in test_overlap_values self.assertCountEqual( AssertionError: Element counts were not equal: First has 0, Second has 1: <NullableIntegerArrayModel: [2]> First has 0, Second has 1: <NullableIntegerArrayModel: [2, 3]> ---------------------------------------------------------------------- (0.001) db.model_fields__nullableintegerarraymodel.aggregate([ { "$lookup": { "as": "__subquery0", "from": "model_fields__nullableintegerarraymodel", "let": {}, "pipeline": [ { "$match": { "$expr": { "$and": [{"$lt": ["$order", 3]}, {"$ne": ["$order", None]}] } } }, {"$project": {"field": 1}}, ], } }, { "$set": { "__subquery0": { "$cond": { "if": { "$or": [ {"$eq": [{"$type": "$__subquery0"}, "missing"]}, {"$eq": [{"$size": "$__subquery0"}, 0]}, ] }, "then": {}, "else": {"$arrayElemAt": ["$__subquery0", 0]}, } } } }, { "$match": { "$expr": { "$and": [ {"$ne": ["$field", None]}, {"$size": {"$setIntersection": ["$__subquery0.field", "$field"]}}, ] } } }, ]); Metadata
Metadata
Assignees
Labels
No labels