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

MaxSize is ignored when creating a capped collection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0
    • Affects Version/s: 2.0
    • Component/s: API, Operations

      When creating a capped collection using the new driver with the old API (i.e. client.GetServer().) the MaxSize is ignored and the resulting collection is capped at 1GB:

      new MongoClient()
          .GetServer()
          .GetDatabase("HamsterSchool")
          .CreateCollection("Hamsters", CollectionOptions.SetCapped(true).SetMaxSize(5368709120));
      

      Using the new API however sets the correct MaxSize:

      await new MongoClient().GetDatabase("HamsterSchool")
          .CreateCollectionAsync("Hamsters",
              new CreateCollectionOptions
              {
                  Capped = true,
                  MaxSize = 5368709120
              });
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            I3arnon Bar Arnon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: