I now have an array of objects, such as the following format:
let objArray = [
{name: "Amy", age: "n", age: 18},
{name: "Amy", age: "n", age: 18},
{name: "Amy", age: "n", age: 18},
{name: "Amy", age: "n", age: 18}
]
I use qs.stringfy () to transcode the object, and then parse it with qs.parse () in the background of node to get the following format
{ "0": { name: "Amy", age: "18" },
"1": { name: "Amy", age: "18" },
"2": { name: "Amy", age: "18" },
"3": { name: "Amy", age: "18" } }
}
the main functions I want to achieve are:
- the front end sends an array of objects, and the node server stores the array of objects (transcoded into json strings) in the database After
- , the server can return this data, and the foreground can get the same array of objects as before