Harpreet Sangar
11/11/2024, 9:49 AMcountry:[`India`] && company_name:[`Acme Corp 6`] && $development(workspace_id: 'a')
Now to understand how this is equivalent to the filter_by
that produces the correct result:
(country:[`India`] && company_name:[`Acme Corp 6`]) && (id:* || $development(workspace_id: 'a'))
Let's suppose we have 3 documents:
• id: 0 that matches `country:[India
] && company_name:[Acme Corp 6
]` filter and references workspace_id: 'a'
• id: 1 that matches `country:[India
] && company_name:[Acme Corp 6
]` filter but references workspace_id: 'b'
• id: 2 that does not match `country:[India
] && company_name:[Acme Corp 6
]` filter and references workspace_id: 'a'
This is how the filter_by
is evaluated:
(0, 1) && ((0, 1, 2) || (0, 2))
That further is evaluated as:
(0, 1) && (0, 1, 2)
That finally returns only the following documents:
0, 1