1

I want to retrieve data from firbase with a condition like this

ref.orderByChild('users').equalTo(userid).on('value', function(snapshot) {
    // Need to return data as firebaseArray here
});

$firebaseArray is very useful when we want to show data on view. But I don't know how to return the snapshot there.

Please help me ! (bow)

1 Answer 1

1

A $firebaseArray can take in a ref or a query.

var query = ref.orderByChild('users').equalTo(userid);
var syncArray = $firebaseArray(query);

The array function handles all the child events and keeps the array in sync with the remote server changes.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks David. Exactly what I want !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.