TLDR Sean sought advice on restricting document access by adding multiple numeric IDs to a 'permissions' field. Sandip confirmed it was possible and provided a search request example.
I’m looking at a way to restrict documents from a collection to specific users in my app.
Is it possible to add multiple numeric ID’s to a field?
Thinking something like a field called ‘permissions’ which can have multiple ID’s, i.e, [123, 124, 125]. Then in the users search, we can add their ID to the filterBy parameter i.e. filterBy: 124, so that we only get results where there ID is included?
Yup, it is possible.
search request should be
Great, actually, just seen in the docs that I can add an array of integers too. perfect!
Indexed 3051 threads
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI