upsert loopback code example
Example 1: loopback upsert with where
PersistedModel.upsertWithWhere([where], data, callback)
Example 2: loopback upsert
PersistedModel.upsert(data, callback)
Example 3: loopback find or create
await server.models.Role.findOrCreate(
{where: {name: val} },
{name: val}
);