Upsert for documents
Created by: JohannesRudolph
Many document DBs with an HTTP API (e.g. RavenDB) implement PUT semantics for saving a document. I like the way this is handled in massive for tables (
save doing an upsert), but for documents the API looks at the existence of a primary key column to determine whether an insert or update should be performed.
Can't we have
saveDoc perform an upsert as well? This would keep the API similar. We could have separate insert/update methods as well.
By the way:
https://github.com/robconery/massive-js/blob/master/lib/document_table.js#L71 declares an
updateDocSync method, but never actually defines the
updateDoc method that it should wrap.