Please assume following structure:
/parentNode
/ ...
/childNode <-- I only want this KEY without retrieving childChildNodes
/childChildNode
/childChildNode
/...andManyManyMoreChildChildNodes...
/childNode <-- by limitToFirst(2) I maybe also want this KEY but again without retrieving all the rest
/childChildNode
/childChildNode
/...andManyManyMoreChildChildNodes...
/...andManyManyMoreChildNodes...
/ ...
I came to something like this:
let child = "1500127452209";
const findDateRef = firebase.database().ref("parent/");
findDateRef.orderByKey().startAt(child).limitToFirst(2).once('value', snap => {
console.log("result I want", Object.keys(snap.val()));
console.log("data retrieved", snap.val());
});
The first log represents the result I want but the second log shows that all the uneeded data was retrieved and filtered on the client which is not what I want.
So how do I stop Firebase from reading child nodes?