Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4445

Support 64-bit values for Skip and Limit/Take

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • 2.19.0
    • Affects Version/s: 2.15.1, 2.18.0
    • Component/s: Aggregation, Builders

      Summary

      The pipeline builder has an offset argument of type `int`:
      https://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver/PipelineStageDefinitionBuilder.cs#L1582

      Which in C# is a 32-bit signed integer.

      But the specification for the $skip function is actually a 64-bit positive integer:

      https://www.mongodb.com/docs/rapid/reference/operator/aggregation/skip/

      The documentation doesn't make it clear if its supposed to be a signed or unsigned 64 bit integer but given that it says "positive" I'm assuming its a signed integer equal to or greater than 0.

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      I'm using 1.15.1, but the code is still in master so at this time 1.18.0, probably all recent versions.

      All topologies.

      How to Reproduce

      Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example.

      PipelineStageDefinitionBuilder.Skip<Example>(long.MaxValue)

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            justin.m.chase@gmail.com Justin Chase
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: