Vlad Lunachev
03/28/2025, 12:34 AMratings
field that looks like this:
"ratings": [
{
"rating": 5,
"title": "general"
},
{
"rating": 2,
"title": "specific"
}
]
Users can add their own ratings, but I'm running into an issue with filtering. I want to filter documents where, for example, the specific
rating is greater than 3.
If I define the schema as:
- ratings
as object[]
, or
- ratings.title
as string[]
and ratings.rating
as int32[]
,
the filter might match a title
from one object and a rating
from another, rather than ensuring both criteria apply to the same nested object.
Is there a way to specify that both conditions (title
and rating
) must be satisfied within the same nested object? Any guidance or workarounds would be greatly appreciated!
Similar issue can be with the color search
"rgba": [
{ "r": 255, "g": 0, "b": 0, "a": 1 },
{ "r": 0, "g": 255, "b": 0, "a": 0.5 }
]
and I want to filter specific ranges for r, g, b, a - it also should match within one object in the array.
Thanks in advance!Kishore Nallan
03/28/2025, 4:17 AM