mongoid/mongoid-site — pull request #96 by elubow (2011-10-21 19:19:17+00:00)
Title: Dropping Indexes not clearly defined

For the most part, it looks easy to drop an index using Mongoid. But it's not well explained that when you want to drop an index, you need to use the MongoDB name and not the field name (ie `foo` vs. `foo_1`). It becomes even less obvious when you have `foo_-1` as the result of creating a range index.

I actually think the proper solution to this would be to have the driver be able to coerce `[['foo',Mongo::DESCENDING]]` into `foo_-1`, but in the absence of me having the time to do that, I decided instead to update the documentation with an explanation of how to drop an index in the Rails console. I think it can also be fairly easily understood that the same methodology applies to something in a rake task.