The correct way to get your desired result is with...
# community-help
h
The correct way to get your desired result is with the following `filter_by`:
Copy code
country:[`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:
Copy code
(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:
Copy code
(0, 1) && ((0, 1, 2) || (0, 2))
That further is evaluated as:
Copy code
(0, 1) && (0, 1, 2)
That finally returns only the following documents:
Copy code
0, 1