larpon / QtFirebase

An effort to bring Google's Firebase C++ API to Qt + QML
MIT License
284 stars 83 forks source link

Child of child #115

Closed panmareksadowski closed 5 years ago

panmareksadowski commented 5 years ago

How can I retrieve child of child? Supposed that I have database:

{
"child1":{
    "child2":{
        "property1":"value"
    }
}

I tried in qml request.child("child1").child("child2").exec(), where request is DatabaseRequest. Than snapshot.exists() is always false.

larpon commented 5 years ago

I'm not very well experienced with the Database module - but have you tried giving child a path-like string?

maybe something like (... and this is pulled out of thin air): request.child('child1/child2')

panmareksadowski commented 5 years ago

Yes, it works. However request.child("child1/child2").equalTo("value", "property1").exec() doesn't work.