Right now I'm trying to determine which is more efficient for a problem I have. Here's the situation:
Problem Statement I have an array of objects that I want to update/insert into my Couchbase database. If they are already in the database, they should update all fields but one. If they are not in the database, they should simply be inserted in. I have a working parametrized Merge statement that does what I want, where it accepts the array of objects as a parameter and does the update/inserts accordingly. But I was wondering, is it more efficient to run that single query, or is it better to loop through the array and for each object run a Get() key-value operation for each object to see if it exists in the db and then run an insert() function?
Unfortunately, I don't have a great estimate on the size of the array, but what I do know is that this job won't be run very frequently, if that's any help. Thanks in advance for your help!