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

Allow seed to be specified during $sample.

    XMLWordPrintable

    Details

      Description

      There are several tickets currently open relating to statistical bias (SERVER-22068) and incorrect seeding (SERVER-22069). This request relates to the ability to explicitly pass in a PRNG seed as part of the $sample pipeline.

      There are a number of situations that come immediately to mind where the ability to explicitly specify a seed would be beneficial. The first, that I mentioned via IRC, is that of an e-commerce system showing "random featured products" which rotate daily. Using the current Julian calendar date as the seed would naturally rotate daily and allow for both historical and future/predictive result generation. This is similar to the pattern games such as Minecraft use to allow specifying a seed for algorithmic world generation.

      The syntax would become:

          { $sample: { size: <positive integer>, seed: <integer> } }
      

      The seed, if omitted, could be PRNG generated itself.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-query Backlog - Query Team
            Reporter:
            amcgregor Dissatisfied Former User
            Participants:
            Votes:
            1 Vote for this issue
            Watchers:
            12 Start watching this issue

              Dates

              Created:
              Updated: