1

I would like to check if the array "devices" which is in the document "SOjTxEjMwb71isiiPnR8" contains the value "AE0EBAFA-1560-404B-A3DA". I just want to know this specific array in the specific document. Because it can be that the same value in the same array occurs in another document. How do I have to do this in Swift? Thanks a lot for your help.

Firestore Image

1 Answer 1

3

You're looking for the array-contains operations, which in Swift looks like this:

devicesRefRef
  .whereField("devices", arrayContains: "AE0EBAFA-1560-404B-A3DA")

You can then get the results once or listen for realtime updates. You'll note that all links I provide are to the relevant sections of the documentation, so I recommend spending some time there.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.