I have the following JSON I get sent back from my database and I am trying to access the 'name' and 'contact's keys:
[
{
"key": {
"name": "a",
"kind": "Users",
"path": [
"Users",
"a"
]
},
"data": {
"fullname": "a",
"password": "a",
"contacts": [
"bob", "john"
]
}
},
{
"key": {
"name": "b",
"kind": "Users",
"path": [
"Users",
"b"
]
},
"data": {
"fullname": "b",
"password": "b",
"contacts": [
"john"
]
}
}
]
My java script callback function looks something like this and inside I am trying to print the values from the entities variable:
dataset.get(keys, function(err, entities) {});
I tried: entities.key.name[0] to get the first name key value, but it does not work. I am also stuck how to then get the contacts variable.
entities[0].key.name