loopback updateAttributes code example
Example: loopback find or create
await server.models.Role.findOrCreate(
{where: {name: val} },
{name: val}
);
await server.models.Role.findOrCreate(
{where: {name: val} },
{name: val}
);