Lucid models: understanding primaryKeyValue


#1

I found this in the documentation:

The value of the primary key (only update when incrementing is set to false ):

const user = await User.find(1)
console.log(user.primaryKeyValue)

// when incrementing is false
user.primaryKeyValue = uuid.v4()

Can someone explain what is that uuid.v4()? uuid may be the primary key, but what is that v4() function? Where does it come from?

Thank you.


#2

Here’s wiki on uuid. The example just shows an example with uuid spec compliant npm package