Sunday, 30 April 2017

firebase cloud function for sorting values

i want to write a firebase cloud function that can sort data by values but its not working here is my code

exports.membersposition = functions.database.ref('/queues/{queueid} /members').onWrite(event => {
const membersRef = event.data;

return membersRef.orderByChild('timestamp').on('child_added')
    .then(snapshot => console.log(snapshot.key()));
});

Can any body fix this



via Emibrown

No comments:

Post a Comment