Using collections

I am trying to use the data values of an id. How would I grab the other items within the grabbed id. I used the get() for wix-data. Like say if I have a collection with id, title, firstname, lastname. and they’re all strings. How would I grab the firstname value from the id in the collection with corvid?

Kasyk,

The below code builds on the documentation example in order to answer your specific question of how to access the other values of the record when you know the id. It helps to use a console.log so you can see the format of the data object returned by a Corvid function in the developer console at the bottom of the page.

wixData.get("myCollection", "6027d937-765e-4139-9471-7ef107185edf")
.then( (results) => {
    console.log(results);
    console.log(results.firstname);
    console.log(results.lastname);
} )
.catch( (err) => {
    let errorMsg = err;
} ); 

Thanks a lot how about for like wix current user? like i created a new field that stores a string and an array.

You can get the current user info from the Wix Users API.
https://www.wix.com/corvid/reference/wix-users.html#currentUser