bugthesystem / FireSharp

An asynchronous cross-platform .Net library for Firebase
The Unlicense
693 stars 147 forks source link

Incorrect keys returned for array items #112

Open nagyvilmos opened 6 years ago

nagyvilmos commented 6 years ago

I an trying to perform a get on the below structure:

parent : {
  child : {
    item : [1, 2, 3,4]
  }
}

using

var response = await this.client.OnAsync("parent",
                (sender, args, context) => { this.DataInsert(args); },
                (sender, args, context) => { },
                (sender, args, context) => { });

In DataInsert, the args.Path and args.Data are:

"\child\item" : 1
"\child" : 2
"\" : 3

the fourth appears as an update with key \.

Updating the values in firebase gives the correct keys back; e.g. \child\item\0 There are different fields, dynamically named and with differing structures ander the parent node, and the data cannot be deserialized into an object. We use both keys and values to work out where data goes and so must read it as key/values.