Updating collection with HTTP-Function

Looking for assistance.

Scenario: I want to update an field in my collection for a specific user when this function is called. I am able to query my collection with the user email and write to the collection with the SAME data.

How do I get the user info, modify a field (step6) and write it back?

I’ve read somewhere I need to have all values for the row otherwise they are blanked out, so how would I take the result of RESULTS and store them into a variable to then write back?

export function put_myFunction(request) {
let options = {
“headers”: {
“Content-Type”: “application/json”
}
};
let UserEmail = request.path[0];

return wixData.query('Memberjourney')
    .eq('email', UserEmail)
    .find()
    .then((results) => {
        if (results.items.length > 0) {

> NEED HELP HERE

            options.body = {
                items: 
            };
            return ok(options);
        }
        options.body = {
            error: `${request.path[0]} wasn't found`
        };
        return notFound(options);
    })
    .catch((error) => {
        options.body = {
            error: error
        };
        return serverError(options);
    });

}

Slight modification to my ask, since this field is not set on the user until this function is called, how would I add to the JSON so I can write it to the collection?

Figured it out, sharing for others. Assigned to variable, added the additional field and updated the collection.

return await wixData.query(‘Memberjourney’)
.eq(‘email’, UserEmail)
.find()
.then((results) => {

        if (results.items.length > 0) {
            let toInsert = {
                "_id": results.items[0]._id,
                "phoneNumber": results.items[0].phoneNumber,
                "email": results.items[0].email,
                "dob": results.items[0].dob,
                "_owner": results.items[0]._owner,
                "_createdDate": results.items[0]._createdDate,
                "profilePicture": results.items[0].profilePicture,
                "firstName": results.items[0].firstName,
                "lastName": results.items[0].lastName,
                "member": results.items[0].member,
                "step1": results.items[0].step1,
                "step2": results.items[0].step2,
                "step3": results.items[0].step3,
                "step4": results.items[0].step4,
                "step5": results.items[0].step5,
                "step6" : true
            };