Hi,
You can use the query function to get the record based on the userid and use the update function to update the record.
Here’s a code snippet to better explain what I’m referring:
async function updateCollectionRecord(recordId) {
let recordToUpdate = await wixData.query("collectionName")
.eq("_id", recordId)
.find()
.then(results => results.items[0]);
recordToUpdate.fieldName = "ValueToUpdate";
wixData.update("collectionName", recordToUpdate)
.catch((err) => {
console.log(err);
});
}
Good luck,
Tal.