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
Anderson da Silva
11/16/2021, 9:49 PM
and how would you update a record you don't have yet?
Anderson da Silva
11/16/2021, 9:50 PM
the other way I see to do it is to do a find, if undefined, create. else update
f
febreeze
11/16/2021, 9:52 PM
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
febreeze
11/16/2021, 9:52 PM
i do know why its not working, because there could exist multiple records with this dataSet
febreeze
11/16/2021, 9:53 PM
i would like to upsert the first found
febreeze
11/16/2021, 9:57 PM
this just seems very inefficient
r
Ryan
11/17/2021, 9:22 AM
@febreeze 👋
Until we support upsertMany, this would be the only way. You could also wrap it in a transaction to make it safer.