Is there anything that could simplify this?
databaseRef.child("palettes").queryOrdered(byChild: "0").queryEqual(toValue: text).observeSingleEvent(of: .value, with: { (snapshot) in
print (snapshot)
})
databaseRef.child("palettes").queryOrdered(byChild: "1").queryEqual(toValue: text).observeSingleEvent(of: .value, with: { (snapshot) in
print (snapshot)
})
databaseRef.child("palettes").queryOrdered(byChild: "2").queryEqual(toValue: text).observeSingleEvent(of: .value, with: { (snapshot) in
print (snapshot)
})
databaseRef.child("palettes").queryOrdered(byChild: "3").queryEqual(toValue: text).observeSingleEvent(of: .value, with: { (snapshot) in
print (snapshot)
})
databaseRef.child("palettes").queryOrdered(byChild: "4").queryEqual(toValue: text).observeSingleEvent(of: .value, with: { (snapshot) in
print (snapshot)
})
I wish to query and search for a similar color hex code and then obtain the entire array along with it so the arrangements of my database have to be as such: