Ad
Retrieve Only Some Params From A Node At Firebase (web)?
Does firebase allows me to fetch only some params from a node ?
Example User has: id, name, email, birthday, zip_code
But I only want id
and name
for an specific search.
To get users list at web app I can do:
var database = firebase.database();
return firebase.database().ref('/users).once('value').then(function(snapshot) {
console.log('list de users: ');
console.log(snapshot.val());
});
But this retrieves all users params, how can I get only id and name from /users
at Firebase?
Ad
Answer
You can't specify a subset of children to fetch for a single query. When you query at a location in the database, you will always get all children of that location, as deeply nested as they go.
If you only want certain children, you will have to make a separate request for each one of them at their fully specified paths.
Ad
source: stackoverflow.com
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
Ad