How can I upsert a record and array element at the same time?
That is meant to be read as a dual upsert operation, upsert the document then the array element. So MongoDB is a denormalized store for me (we're event sourced) and one of the things I'm trying to deal with is the concurrent nature of that. The problem is this: Events can come in out of order, so each update to the database need to be an upsert. I need to be able to not only upsert the parent document but an element in an array property of that document. For example: If the document doesn't exist, create it. All events in this stream have the document's ID but only part of the information