Closed xiaods closed 11 years ago
Are you referring to indexes (schema) that get auto-created by mongoose? If so, I had a similar problem, but I'm not sure that removing indexes is the job of mocha-mongoose. That seems more like a migration problem. I agree that it's a problem due to mongoose (potentially) auto-creating indexes.
I would welcome a pull request for this feature. The test would likely create a unique index, clear the database, then try to create two documents that would have conflicted if the unique index were still there.
No response from issue opener, but I'm assuming this is similar to #6.
To give a constructive answer of how to drop indexes, I suggest you look at the stack overflow post: http://stackoverflow.com/questions/13014548/what-is-the-recommended-way-to-drop-indexes-using-mongoose
@elliotf thanks, it's works for the stackoverflow
I'm glad it works for you, @xiaods !
I found collection.remove don't remove relative index, how to handle it?