From 2e05f50d4e5166f0decda71b55ab3fbf2b200ae3 Mon Sep 17 00:00:00 2001 From: "Thomson, Alec (CASS, Kensington)" Date: Mon, 20 May 2024 13:53:30 +1000 Subject: [PATCH] Use elemMatch --- arrakis/makecat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arrakis/makecat.py b/arrakis/makecat.py index 55d69b12..e694fe7a 100644 --- a/arrakis/makecat.py +++ b/arrakis/makecat.py @@ -887,7 +887,9 @@ def main( query = { "$and": [ {"Source_ID": {"$in": all_island_ids}}, - {"rm_outputs_1d.field": save_name, "rm_outputs_1d.rmsynth1d": True}, + {"rm_outputs_1d": {"$elemMatch": {"field": save_name}}}, + {"rm_outputs_1d": {"$elemMatch": {"rmsynth1d": True}}}, + {"rm_outputs_1d": {"$elemMatch": {"rmclean1d": True}}}, ] }