Adding setting or removal of index on collection creation and collection destruction.