2014년 12월 15일 월요일

Is update() with upsert parameter atomic?

I'm aware that FindAndModify() with upsert parameter might yield insertion of several documents in case that another client insert a document between the query and modify phases. Does update() with upsert behaves the same or is it atomic? Does it also have two phases that might we interrupted with another DB activity?



AFAIK, the only way to insert without any duplicates is to have a field with a unique index set on it.



댓글 없음:

댓글 쓰기