Hello,
I have a query like this
collection.aggregate(
[
{"$match": {_id: 123}},
{"$project": {"attributes.key": 1, "attributes.value": 1}},
{
"$project": {
attributes: {
"$filter": {
input: "$attributes", as: "attr", cond: {"$in": ["$$attr.key", [1, 2, 3]]}
}
}
}
}
]
)
And want to use replica to run this. I added {read: {mode: :secondary_preferred, max_staleness: 120}}
as options. And now I’d like to check/confirm replica was used. I tried to run explain
on the result but it doesn’t provide any information like that. Is there a way to check what was used to run aggregate query like this?