uuhm, anyone knows how to do this? I want to upser...
# orm-help
f
uuhm, anyone knows how to do this? I want to upsert a table where multiple conditions match. Do i really need to search first and then update??
a
and how would you update a record you don't have yet?
the other way I see to do it is to do a find, if undefined, create. else update
f
yes, thats obviously what i meant 😄 but this is basically recreating the upsert with multiple queries. an upsert with an whereAND clause would be more efficient
i do know why its not working, because there could exist multiple records with this dataSet
i would like to upsert the first found
this just seems very inefficient
r
@febreeze 👋 Until we support upsertMany, this would be the only way. You could also wrap it in a transaction to make it safer.
✅ 1