#Querying field on double nested collection

2 messages · Page 1 of 1 (latest)

brisk prawn
#

Hi Guys ,
in my schema Fizl reference to a Cleaner, which in turn has a reference to a User with a firstName field. I'm trying to filter based on a nested property like cleanerId.userId.firstName
how to do it i'm blocked

pallid timber
#

if you are storing them as ref, you need to populate them or use aggregation, and then simply access it like objects (cleaner.user.firstName) in a match query