aboekhoff/congomongo — Issue #51: Why does update! require a document
Author: semperos
Created: 2012-02-11 04:55:49+00:00
State: open

The default MongoDB update/save functions take a *query* to find the document to be updated; with upsert enabled, this means that a `null` return value would be handled for us and an insert would be performed.

In congomongo, it looks like we have to pass in a full document map to `update!`, which seems to defeat part of the purpose of the `update!` function altogether, in that a call to `fetch-one` returns `nil` if nothing is found.

What's the rationale behind `update!` semantics?