Details
Description
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.