Firebase – Is there a way to get only documents with an array field which contains a certain value?

  firebase, javascript

If I have a simple collection Cats:

Cats:
  Meowy:
    colors: ['orange', 'white']
  Purro:
    colors: ['black', 'orange']
  Bob:
    colors: ['black']

How can I query only the documents that their colors field contains orange (in JavaScript)?

Source: Ask Javascript Questions

LEAVE A COMMENT