I need something like that, but i dont get the correct concatenation with the for and the push. In fact, i would like to avoid doing multiple queries, one per "palabras[i]". It would be excelent if i be able to go only one time to the database:
function ($scope, $rootScope, $stateParams, $firebaseArray) {
var arrayRta = new Array();
var palabras = $rootScope.textAreaOfrecer.toLowerCase().split(' ');
for (i = 0; i < palabras.length; i++) {
var elementosConI = firebase.database().ref().child("solCompras").orderByChild("palabras/" + palabras[i]).equalTo(true);
arrayRta.push(elementosConI);
}
$scope.solicitudes = arrayRta;//$firebaseArray(arrayRta);
}
{
"solCompras" : {
"-KdTUecpbUuWJO_Fbj5Y" : {
"palabras" : {
"123" : true,
"444" : true,
"123123" : true
},
"post" : "123 123123 444",
"user" : "demo"
},
"-KdTcRy_P0rjEpnHwHCC" : {
"palabras" : {
"123" : true
},
"post" : "123",
"user" : "demo"
},