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

add requireSequenceTokens to SearchCommand.CursorOptions

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0, 7.0.5, 6.0.13
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • v7.1, v7.0, v6.0
    • QI 2023-10-02, QI 2023-10-16

      An atlas search customer indicates that they want to paginate results by including the searchSequenceToken field in a $project stage following a $search query. For example: 

       

      db.collection.aggregate([
      {$search:  { text: {path: "foo", query: "test"}},
      {$project: { "myToken" : { $meta : "searchSequenceToken"}},
      {$limit: 2}
      ])
       
      

       

      As the sequence/pagination token is requested outside of the $search query, mongod has to propagate this information to mongot. It will do so by adding `requireSequenceTokens` field to SearchCommand.CursorOptions and marking it as true when it appears in a $project stage following a $search query.

            Assignee:
            maddie.zechar@mongodb.com Maddie Zechar
            Reporter:
            maddie.zechar@mongodb.com Maddie Zechar
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: