Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: put operation #1

Open
renewdoit opened this issue Jan 18, 2010 · 3 comments
Open

Feature request: put operation #1

renewdoit opened this issue Jan 18, 2010 · 3 comments
Labels

Comments

@renewdoit
Copy link

It will be more natural to have a "put" operation, or "insert-or-update".

@mmcgrana
Copy link
Owner

This can be implemented at the client level with e.g.

["checked-write",
  ["count", "records", {"where": ["=" "id" _]}],
  0,
  ["insert", "records", {"id": _, "attr1": "val1", ...}]]

Were you aware of this but suggesting that this be implemented in the server for convenience?

Also, just out of curiosity, are you using a particular client library for interacting with FleetDB?

@renewdoit
Copy link
Author

Not exactly.
What I mean is to check whether a record exists, if not, insert it otherwise update it (merge).
I use client side function to deal with it right now, but I think better to provide it at server side to gain better performance.
I'm using clojure client library to talk with fleetdb.

@mmcgrana
Copy link
Owner

Oh right, I see. In order to this completely on the server's side you would need either the "put" operation you mentioned above or a more general compound query that branched on a conditional. I'm not going to add these right away, but I'm putting them on my list to consider in the near future.

Thanks for your input and patience,
Mark

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

No branches or pull requests

2 participants