1

I have been working with MongoDB and i have noticed that it does not relase Disk space on Collection.RomveAll operation is it a bug or some thing i am doing wrong in my code

                var connectionString = "mongodb://localhost";
                var client = new MongoClient(connectionString);
                var server = client.GetServer();
                var database = server.GetDatabase("test");                
                var collection = database.GetCollection("entities");                

                for (int i = 1; i <= 1048576; i++)
                {
                    var entity = new StringEntity { Name = "Name"+i };
                    var entity1 = new ByteEntity { Data = new byte[1024] };

                    collection.Insert(entity);
                    collection.Insert(entity1);                    
                }

                collection.RemoveAll();
Peter
  • 27,590
  • 8
  • 64
  • 84
Numan Hanif
  • 246
  • 2
  • 17

0 Answers0