I'm new to using the firebase database with javascript, I tried sorting like this
db.ref (). Child ('Items'). OrderByChild ('upvotes')
But it doesn't work as it should.
I need to sort objects by the number of votes, the number of votes is now calculated as follows: upvotes.numChildren() - downvotes.numChildren()
I need to sort them in descending order
Please tell me how to sort by the number of childs of the element, or if it is impossible, some alternatives