Nesting with a random value as parent node?

I’m trying to generate some test data for a Firebase application. In FirebaseTypically a key is generated as the parent node, then the data is nested below that. See below for an example.Each item has a unique key, then the detailed data is nested below that.

Is it possible to generate this kind of structure using Mockaroo?

{
  "-Kpq5xWRncFUmlt6Vh2S" : {
    "Address" : "14 George Street",
    "Lat" : 47.56146946125298,
    "Lon" : -52.71112285358702,
    "PlaceName" : "John's Pub"
  },
  "-Kpr0YraQjleL0FcGxpl" : {
    "Address" : "127 Harbour Drive",
    "Lat" : 47.56105239289505,
    "Lon" : -52.70885098480498,
    "PlaceName" : "Bill's Steakhouse & Bar"
  }
}
2 Likes

Not at the moment, but I’m interested in providing better support for Firebase and the format you provided seems simple enough. Can you point me to any kind of documentation for that format?

1 Like

I just added Firebase as a new output format. Please give it a try and tell me what you think!

1 Like

I don’t think there is any documentation specific to the export format. The JSON data I loaded in my original message was exported directly from Firebase, so that’s the format the data appears in. I’ve used these exports in the past to load data (to reset a database after testing, for example). The best-practices approach is that any node has a key, with the actual data below that key (as shown in the code).

The Firebase export is great! That’s exactly what I was looking for.

how do I format a Firebase looking scheme to look like this with the second element as a “generate” firebase uid?
{
“counselors” : {
“-KuUv2rUWFHoizHWx2Gn” : {
“bio” : "Lorem ipsum ",
“city” : “Atlanta”,
“firstname” : “Diane”,
“lastname” : “Miller”,
“state” : “Georgia”,
“status” : “A”
}
},