Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Document Collection.update, Collection.insert and correct existing write commands #105

Closed
danielmewes opened this issue Jul 28, 2016 · 0 comments
Assignees

Comments

@danielmewes
Copy link
Member

It turns out that we actually have an update and insert function on collections in Horizon (I didn't know about this until a moment ago): https://github.com/rethinkdb/horizon/blob/next/client/src/ast.js#L316

We need to change the following things in http://horizon.io/api/collection/#store :

  • Add documentation for insert: It does what is currently documented for store. Namely it stores a document and errors if the ID already exists.
  • Correct documentation for store: It's actually what's currently documented for upsert. It inserts a document if it doesn't exist, or replaces the document if it already exists.
  • Correct documentation for upsert: The current documentation says that it replaces the document if it exists. But actually it "updates" the document if it exists (leaving unspecified fields in the existing document untouched).
  • Add documentation for update: Like replace, but leaves unspecified fields in the existing document untouched.

The full specification of all write commands is here: https://github.com/rethinkdb/horizon/blob/next/protocol.md#insert-store-upsert-replace-update-remove

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants