コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
        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;
                }
            }
        }