Error while Upserting Documet

If you’ve awaited on the operation before doing the second loop, you should always read your own writes. Other than if there are node failures during your operations, durability doesn’t enter into it.

Ah, unless you’re saying you are doing a query (which I don’t see in the code, depending on what you mean by readTheDocumentUsingId()). For that, if you want your query to be updated with respect to any recent mutations, you’ll want to pass the options for scan consistency, which I think is something like this…

  const qo: QueryOptions = { scanConsistency: QueryScanConsistency.RequestPlus  }

Then pass that in as options on your query.

1 Like