The results that are returned are rows, so you can get all of the fields that you want from the returned results. I’ve added a couple of lines to your code to illustrate:
export function get_myFunction(request) {
return wixData.query("myUsersCollection")
.eq("firstName", request.path[0])
.find()
.then((results) => {
if (results.items.length > 0) {
const body = "Found it!";
let item = results.items[0]; // get first row of results
let lastName = item.lastName;// get desired field
return ok({ body: body });
}
const body = "Not in the system";
return notFound({ body: body });
});
}
I hope this helps.
Yisrael