This is the structure of the database,
Content {
"randomID" {
"randomID2" {
"text": "Hello World"
}
}
}
I'm trying to do a query in cloud functions, to check if text is equalTo a specific value but it always returns null
admin.database().ref('Content').orderByChild('text').equalTo("someText").once('value').then(snapshot => {
console.log(snapshot.val()); -> this returns null
})
I'm pretty sure the issue is that I have two random ID's there, also wildcards don't work for .once('value') like they do for onUpdate I believe. Or I'm doing something wrong as I'm quite new to Javascript.