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

DeleteMany().DeletedCount overflow

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.3
    • Component/s: Operations
    • None
    • Environment:
      MongoDB 3.2.10, windows 10 64-bit (the same on centOS)
    • Fully Compatible

      For example, I have collection wtih documents count a little bit more than int.MaxValue.
      DeleteMany to all documents on this collection returns DeletedCount (long). This DeletedCount will be negative, because an overflow has occured.

      var mongoServer = Create("mongodb://localhost:27017", 1024, 1024);
      var db = mongoServer.GetDatabase("overflow");
      var coll = db.GetCollection<MyInt>("overflowcoll");
      var deletedCount = coll.DeleteManyAsync(filter)
                      .GetAwaiter().GetResult().DeletedCount;
      

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            Wheee Alexander Babkin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: