loliki
loliki

Reputation: 957

Firebase ios select from database where value equals to something

I have a firebase database and want to get the values from the DB into swift but I need to filter the data as I have 2 types of data Inc and Exp how can I create a query for Firebase that will select all the fields where Type = Exp for example

Here is how my DB looks like

enter image description here

Upvotes: 0

Views: 225

Answers (1)

Daniel Medina Sada
Daniel Medina Sada

Reputation: 478

if you get your response from firebase as an Array, you can do

response = response.filter({yourItem.type == "Exp"})

Upvotes: 1

Related Questions