Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how do I save data structure which content object, array and nested array into Baas?

Not applicable

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 Solved
0 6 477
1 ACCEPTED 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

View solution in original post

6 REPLIES 6
Top Solution Authors