loopback save code example
Example 1: loopback create many
this.productApi.create(
[
{name: "Toy Car"},
{name: "Purse"},
{name: "Charger"}
]
).subscribe((res)=>console.log(res))
Example 2: loopback upsert
PersistedModel.upsert(data, callback)
Example 3: loopback find or create
await server.models.Role.findOrCreate(
{where: {name: val} },
{name: val}
);