I have code that calculates an array and I want to populate a group of objects inside the array. I can create one object that’s fine but multiple objects? I was going to use .push but that doesn’t seem to work.
My intention is to create an array of JavaScript objects to populate a repeater.
I will use bulkUpdate, but instead of this wixData.bulkUpdate(“myCollection”, [toUpdate1, toUpdate2])
I would like to create an array of JS objects and use this wixData.bulkUpdate(“myCollection”, [toUpdate])
Would this be possible? I seem to be stuck on creating a group of objects using in code…just as below…the code should create this…
let toUpdate1 = {
6 "_id": "00001",
7 "title": "Mr.",
8 "first_name": "John",
9 "last_name": "Doe"
10};
11
12let toUpdate2 = {
13 "_id": "00002",
14 "title": "Ms.",
15 "first_name": "Jane",
16 "last_name": "Doe"
17};
18
19