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

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

    XMLWordPrintable

Details

    Description

      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.

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              3 years, 20 weeks, 4 days ago