Noobie question regarding query

You are doing UNNEST which repeats original document the array size and each time adds different array element.

If you are only interested if the given condition present in ARRAY use the nested ANY clause like below.

SELECT gs.*
FROM gs_staging AS gs 
WHERE gs.cbType="course" AND gs.status="live" AND 
           ANY track IN gs.tracks SATISFIES 
                   (ANY val IN track.schedule SATISFIES val > 1542035900782 END ) 
           END
ORDER BY gs.created  DESC 
LIMIT 4;
1 Like