When a member changes his email address

HI,

I am using wix members app to run my members logins and from that i used another collection to collect more data from the members as you cant add to the private members data. This works fine no issues with that however one of extra fields i collect from them is a contact email address this email i want to use in a form to collect my members diet and physique checkins. This table will become very large and is populated by the email they provide in the extra field called contact email. If the user changes their contact email i want all their previous records that they uploaded in that collection to be updated.

how can i do this ?

thanks

Fraser

Hello again,

https://www.wix.com/corvid/reference/wix-data/update

import wixData from 'wix-data';
2
3// ...
4
5let toUpdate = {
6  "_id":          "00001",
7  "title":        "Mr.",
8  "first_name":   "John",
9  "last_name":    "Doe"
10};
11
12wixData.update("myCollection", toUpdate)
13	.then( (results) => {
14		let item = results; //see item below
15	} )
16	.catch( (err) => {
17		let errorMsg = err;
18	} );