Hello,
I am trying to save whole data structure to Baas. My data structure is combination of object, array and nested array. It looks like this below:
var abc= {
keys:{
key1:{
name: "dhwani",
type: string,
default:true/false,
value: "trivedi"
},
key2:{
name: "age",
type: number,
default:true/false,
value: 10
}
},
myArray: [{
index: "name",
name: "abcdef",
value: null,
type: string,
default: true/false
},{
index: "name",
name: "pqrst",
value: "black",
type: string,
default: true/false
}],
myArrayInNewArray: [{
index: "name",
name: "abcdef",
value: null,
type: string,
default: true/false
},{
index: "name",
name: "abcdef",
type: array,
default: true/false,
value: newArray[{
index: "name",
name: "abcdef",
type: array,
default: true/false,
value: insideNewArray [{
type: 12345,
value:"test.com",
type: string
}]
}]
}]
}
I am getting confused that does Baas is capable to store or not? If yes then how?
Thank you.
Regards,
Dhwani.
Solved! Go to Solution.
You can store any json object in BaaS. A json object can contain arrays and complex objects.
The keys should be string for it to be json. So your initial elements will look like :
{ "keys": { "key1": { "name": "dhwani",
and use this online tool : http://jsonlint.com/ to validate the json.
A json array is structured as follows:
"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter","lastName":"Jones"} ]
See further examples here: http://json.org/example.html