Please click on this link to access the interactive coding playground and code along with me: playground
I have a collection called Pages where each document contains keys Urls and DraftUrls, which are represented as an array of objects listed below:
IncomingUrl: string;
EclipseId: string;
Status: string;
RedirectionLink: string;
Validity: Date;
Config: ConfigData[];
Indexing: boolean;
Now, my objective is to determine the number of URLs that either have an Inactive status or have an expired Validity date. Additionally, I need to extract additional information such as GroupName and TemplateName.
I attempted to utilize $filter with $or as demonstrated in the playground example, but encountered an issue where it returned the total count of all URLs without considering the specified conditions within the query.
Initially, I suspected a problem with how the Validity field was being evaluated. However, even after removing that condition and focusing solely on the Inactive state, the result still displayed the count of all URLs instead of filtering based on the desired criteria.