Details

    • Technical task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0
    • None
    • memcached
    • None

    Description

      This will check if an item exists within an array. It will have the same semantics as ADD_UNIQUE except its function will not be to replace the value, but simply determine if it is present.

      Attachments

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

        Activity

          drigby Dave Rigby added a comment -

          What's the semantics if an item exists multiple times?

          Might be cleaner to rename to SUBDOC_UNIQUE_ARRAY_CONTAINS (i.e. expects to operate on mathematical sets), and returns true if the value exists at least once.

          drigby Dave Rigby added a comment - What's the semantics if an item exists multiple times? Might be cleaner to rename to SUBDOC_UNIQUE_ARRAY_CONTAINS (i.e. expects to operate on mathematical sets), and returns true if the value exists at least once.
          mnunberg Mark Nunberg (Inactive) added a comment - - edited

          I had in mind for it to return the first index (or any index) of the item if it exists. It is designed to work on lists which have elements added to them via ADD_UNIQUE. It can also work on lists which have duplicates in them, but might not in itself be very useful. Compare Python's list.index(). In this case, maybe it should be called INDEX_OF?

          mnunberg Mark Nunberg (Inactive) added a comment - - edited I had in mind for it to return the first index (or any index) of the item if it exists. It is designed to work on lists which have elements added to them via ADD_UNIQUE. It can also work on lists which have duplicates in them, but might not in itself be very useful. Compare Python's list.index(). In this case, maybe it should be called INDEX_OF?
          drigby Dave Rigby added a comment -

          INDEX_OF seems clearer to me - let's go with that.

          drigby Dave Rigby added a comment - INDEX_OF seems clearer to me - let's go with that.

          Reassigning to the appropriate team for further evaluation. Note the parent issue with some input from Tyler Mitchell.

          ingenthr Matt Ingenthron added a comment - Reassigning to the appropriate team for further evaluation. Note the parent issue with some input from Tyler Mitchell .

          People

            Unassigned Unassigned
            mnunberg Mark Nunberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty