Lucid models: understanding primaryKeyValue


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)

// 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.


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