Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-150

Increment examples show incorrect initialization of key

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.6
    • Fix Version/s: 1.2.1
    • Component/s: docs
    • Labels:

      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

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Show
        perry Perry Krug added a comment - Never mind, I see it now: http://www.couchbase.com/docs/couchbase-sdk-net-1.2/couchbase-sdk-net-update-increment.html
        Hide
        perry Perry Krug added a comment -

        Hey John, could you fill in the links of the areas that changed?

        Thanks

        Show
        perry Perry Krug added a comment - Hey John, could you fill in the links of the areas that changed? Thanks
        Hide
        john John Zablocki (Inactive) added a comment -

        Released

        Show
        john John Zablocki (Inactive) added a comment - Released
        Hide
        perry Perry Krug added a comment -

        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

        Show
        perry Perry Krug added a comment - 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
        Hide
        john John Zablocki (Inactive) added a comment - - edited

        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?

        Show
        john John Zablocki (Inactive) added a comment - - edited 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?
        Hide
        perry Perry Krug added a comment -

        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?

        Show
        perry Perry Krug added a comment - 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?
        Hide
        john John Zablocki (Inactive) added a comment -

        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

        Show
        john John Zablocki (Inactive) added a comment - 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

          People

          • Assignee:
            john John Zablocki (Inactive)
            Reporter:
            perry Perry Krug
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes