loopback upsert with where
snippet in javascript

loopback upsert with where

user6652

PersistedModel.upsertWithWhere([where], data, callback)

loopback upsert

user5638

PersistedModel.upsert(data, callback)

loopback find or create

user2289

 await server.models.Role.findOrCreate(
 	{where: {name: val} },
 	{name: val}
 );

loopback create many

user7297

this.productApi.create(
  [
    {name: "Toy Car"},
    {name: "Purse"},
    {name: "Charger"}
  ]
).subscribe((res)=>console.log(res))