databasedartpocketbase

PocketBase filter data by with multiple relation set


i have a collection where the field "users" contains the id's of two users.

how can i search for this dataset where this both user id's are.

enter image description here

i tried

users = ["28gjcow5t1mkn7q", "frvl86sutarujot"]

still don't work


Solution

  • had asked the same question on twitter and received an answer from @pocketbase:

    1. Use the "?" ("at least one of") operators, eg.: http://users.id ?= "${userId}"

    2. Use the "~" contain/like operator against the serialized value: users ~ "${userId}"

    the secord option solved my problem ❤️