Hi experts,
I am executing the following code to update some specific fields in the database.
As you can see in the picture the first 2 rows have been filled with the references (Adler, Dietrich) as expected but the bulkupdate also did overwrite the “Title” and “Anfang” column. (There was text before)
I was expecting that within the _id row only the field “lyra” or “omego” will be updated rest stays the same!?
Any idea how to accomplish this?
Thanks guys!
export function button12_click(event) {
let toUpdate1 = {
"_id": "3d8bc591-6621-4e4f-a61f-9ef3723576e6",
"omego": "554b6375-9015-4127-b9e1-2303c12926ee",
};
let toUpdate2 = {
"_id": "c1e69eff-678c-4684-a4aa-dde451dd65bb",
"lyra": "554b6375-9015-4127-b9e1-2303c12926ee",
};
wixData.bulkUpdate("Gruppenkalender", [toUpdate1, toUpdate2])
.then( (results) => {
let inserted = results.inserted; // 0
let insertedIds = results.insertedItemIds; // []
let updated = results.updated; // 2
let skipped = results.skipped; // 0
let errors = results.errors; // []
console.log(results)
} )
.catch( (err) => {
let errorMsg = err;
} );
}