In the sample data you provided in <<20> there is no node with the key 54ca2c11d1afc1612871624a .
Your keys are -Jh46tlaNFx_YmgA8iMJ and -Jh474kAvoekE4hC7W3b . You can easily determine this yourself:
ref.child("studentList").orderByKey().on("child_added", function(snapshot) { console.log(snapshot.key());
It seems you want to order nodes by their value, but this is not the operation that is currently available on Firebase. Firebase can request children by the value of a named property , key, or its priority . Therefore, if you change the data structure to:
disney studentList -Jh46tlaNFx_YmgA8iMJ: name: "aaaaabbbbbbaaaa" -Jh474kAvoekE4hC7W3b: name: "54ce1cbec4335cd3186105dc"
You can get the childrenโs order by name:
ref.child("studentList") .orderByChild("name") .equalTo("54ca2c11d1afc1612871624a") .on("child_added", function(snapshot) { console.log(snapshot.val()); });
Only the side of the node: if your actual node values โโare similar to those specified in the example you provided, you might want to use the values โโas keys; they already seem quite unique to my unprepared eye.
source share