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

Must create before increment_counter. Discuss #28

Open
pas256 opened this issue Jan 21, 2016 · 0 comments
Open

Must create before increment_counter. Discuss #28

pas256 opened this issue Jan 21, 2016 · 0 comments

Comments

@pas256
Copy link
Contributor

pas256 commented Jan 21, 2016

Currently, if you call increment_counter on an id that doesn't existing in the table yet, the response is:

{
  "status": "error",
  "error_message": "The provided expression refers to an attribute that does not exist in the item",
  "error_code": "ValidationException",
  "error_type": null,
  "raw_response": null,
  "data": null,
  "metadata": null
}

That means you must first call create and give the item a starting number before you can subsequently call increment_counter.

I am thinking it would be nice to handle that inside cruddy. When the above happens, make a subsequent call to create and set the counter_name to whatever the increment is as the initial number.

Thoughts?

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

No branches or pull requests

1 participant