Created
October 27, 2018 01:53
-
-
Save diogomachado/51fc26855e67948a8715f3fc9767e665 to your computer and use it in GitHub Desktop.
Pesquisa - Realtime Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pesquisa = "Diogo So"; | |
var query = db | |
.ref('albuns') | |
.orderByChild('nome') | |
.startAt(pesquisa) | |
.endAt(pesquisa + "\uf8ff"); | |
query.on('value', function(snapshot){ | |
if (snapshot.val()){ | |
var resultado = snapshot.val(); | |
}else{ | |
console.info("Nada encontrado"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nesse caso estamos pesquisando no banco em /albuns, buscando no filho nome, em JSON a representação fica assim: