Hey guys, how are you doing? I’m having trouble tr...
# community-help
d
Hey guys, how are you doing? I’m having trouble trying to filter records by an exact match on an array field, ex: giving the following documents:
Copy code
[
    {
        "field": ["value1", "value2"]
    },
    {
        "field": ["value1"]
    },
    {
        "field": ["value1", "value2", "value3"]
    }
]
I need to find the one that only contains
value1
, in this case it would be the second one. I’ve read the documentation but haven’t found anything like this. Is it possible? Thanks
j
It's not possible to do this type of querying in Typesense, based on the exact count of elements inside of arrays
You could consider converting
field
into an array of space separate strings, then use string based filtering for it
d
Hey Jason, thanks for the reply, it’s a nice workaround, I also tought on storing another field for the array length so I can be sure that the values I’m looking are the only ones.
👍 1