John Doah
John Doah

Reputation: 1999

Can't import .json file to Firebase database.x

I'm trying to import my json file (called users.json), this is the file content:

{
  users:{

  },
  friends:{

  }
}

I'm trying to import it to the firebase but it says "invalid json file". What am I doing wrong?

Upvotes: 0

Views: 910

Answers (2)

Alex Mamo
Alex Mamo

Reputation: 138824

A JSON File shoul look like this:

{
  "users" : {
    "UID1" : {
      "userEmail" : "name1@email,com",
      "userName" : "name1",
    },
    "UID2" : {
      "userEmail" : "name2@email,com",
      "userName" : "name2",
    },
  },
    "friends" : {
    //
  }
}

Hope it helps.

Upvotes: 0

Michał Pietraszko
Michał Pietraszko

Reputation: 6199

Every key in JSON file has to be surrounded by quotation marks.

{
  "users":{

  },
  "friends":{

  }
}

Upvotes: 2

Related Questions