[NCBC-150] Increment examples show incorrect initialization of key Created: 07/Nov/12 Updated: 06/Feb/13 Resolved: 06/Feb/13 |
|
| Status: | Resolved |
| Project: | Couchbase .NET client library |
| Component/s: | docs |
| Affects Version/s: | 1.1.6 |
| Fix Version/s: | 1.2.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Perry Krug | Assignee: | John Zablocki |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | customer | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
http://www.couchbase.com/docs/couchbase-sdk-net-1.1/couchbase-sdk-net-update-increment.html
All of the examples on this page show the default value as an integer when in reality it needs to be enclosed in quotes in order to function properly. There should also be a note/warning in the documentation warning users of this idiosyncrasy |
| Comments |
| Comment by John Zablocki [ 08/Jan/13 ] |
|
The default value should be a ulong as shown in the docs. I've updated the docs (and sent a pull request) to note that it's not possible to use with Store.
https://github.com/enyim/EnyimMemcached/issues/86 |
| Comment by Perry Krug [ 09/Jan/13 ] |
|
Hey John, thanks for taking a look at this.
What do you mean that it's not possible to use with Store? Do you mean it's not supported to initialize a counter with store, or just that you can't use a ulong? |
| Comment by John Zablocki [ 09/Jan/13 ] |
|
Well, technically (as you noted) it will work to set a string value via Store and then increment it, but I think that's unintentional behavior and works only because (as Attila pointed out in the linked issue) of the way counters are treated on the server. The correct use of the API should be to initialize a counter with Increment or Decrement by setting the default value.
Either way I think there's an intentional step imposed on the developer. I think it's better to discourage setting a value as a string to initialize a counter, since that's not very intuitive. Thoughts? |
| Comment by Perry Krug [ 09/Jan/13 ] |
|
Thanks for the clarification, makes perfect sense to me.
I do, however, think we need to make that distinction clearer in the docs, both on the increment side and the store side to let customers know what the best practices are (what to do is good, what NOT to do is even more important IMO) Thanks |
| Comment by John Zablocki [ 05/Feb/13 ] |
| Released |
| Comment by Perry Krug [ 06/Feb/13 ] |
|
Hey John, could you fill in the links of the areas that changed?
Thanks |
| Comment by Perry Krug [ 06/Feb/13 ] |
| Never mind, I see it now: http://www.couchbase.com/docs/couchbase-sdk-net-1.2/couchbase-sdk-net-update-increment.html |