Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12340

Clarification on the usage of limit() and skip() used together in a sharded cluster

      Description

      In the following page: https://docs.mongodb.com/manual/core/sharded-cluster-query-router/ ,
      we describe the interaction of limit() and skip() as

      When used in conjunction with a limit(), the mongos will pass the limit plus the value of the skip() to the shards to improve the efficiency of these operations.

      It is correct, however it could be misinterpreted as the skip() being run on each shard.

      The following may be more precise.

      When used in conjunction with a limit(), the mongos will pass
      the limit plus the value of the skip() to the shards as the number
      of document to limit to, without applying any skip.
      The mongos will then have the appropriate documents to
      apply the final limit() and skip() correctly.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            daniel.coupal@mongodb.com Daniel Coupal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              1 year, 26 weeks, 2 days ago