Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49214

Add $toHashedIndexKey expression

    • Fully Compatible
    • v4.4, v4.2
    • Sharding 2020-07-13, Sharding 2020-06-29, Sharding 2020-07-27, Sharding 2020-08-10

      Syntax:

      { $toHashedIndexKey: <input>}
      

      Add a new aggregation expression that computes the hash of the input expression using the hash function used to create a hashed index. The expression's evaluate method should pass each element of the input parameter to BSONElementHasher::hash64 with seed DEFAULT_HASH_SEED. If the input expression evaluates to null or missing, still hash this value to mimic MongoDB indexing behavior.

       This will be used as a part of determining new initial split points when resharding a collection.

            Assignee:
            kshitij.gupta@mongodb.com Kshitij Gupta
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: