0

I need to parse this file extract that comes from Firebase:

{
"historics" : {
    "users" : {
        "anonymous:-JlVsu77kK6lGV-undZT" : {
            "age" : "25",
            "browser" : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0",
            "pseudo" : "Foo",
            "startSession" : 1427554673910,
            "stopSession" : 1427554695420
        },
        "anonymous:-JTJdu598K6lGV-undgb" : {
            "age" : "25",
            "browser" : "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0",
            "pseudo" : "Bar",
            "startSession" : 1427554673910,
            "stopSession" : 1427554695420
        }
    },
    "messsages" : {
        "-Jersu826K6lGV-undgr" : {
            "value" : "test",
            "owner" : "anonymous:-JTJdu598K6lGV-undgb",
        }
    },
    "locations" : {
        "-JlVsuEtf7M0eOgJl5R-" : {
            "owner" : "anonymous:-JlVsu77kK6lGV-undZT",
            "location" : "/bar"
        },
          "-JlVsvX3-kjMvvnvjv9h" : {
            "owner" : "anonymous:-JlVsu77kK6lGV-undZT",
            "location" : "/bar"
         },
          "-JlVsvXG_ZVA6z-g3ogN" : {
            "owner" : "anonymous:-JlVsu77kK6lGV-undZT",
            "location" : "/foo"
         }
    }
}   
}

I don't know how proceed. When i try to create a json metadata, i can't loop over all users. Just the first one is possible.

enter image description here

How can i parse this file?

Scandinave
  • 1,388
  • 1
  • 17
  • 41

0 Answers0