private void SetCappedCollectionOptions(CreateCollectionOptions options) { var unitResolver = new UnitResolver(); var newCollectionMaxSize = unitResolver.Resolve(NewCollectionMaxSize); var newCollectionMaxDocs = unitResolver.Resolve(NewCollectionMaxDocs); if (newCollectionMaxSize > 0) { options.Capped = true; options.MaxSize = newCollectionMaxSize; if (newCollectionMaxDocs > 0) { options.MaxDocuments = newCollectionMaxDocs; } } }