mongoose.set('autoIndex', false)
having no effect
#8158
Labels
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
Milestone
Do you want to request a feature or report a bug? I'm not sure. The documentation in one place says this should work. In another place, it does not mention it. If this is supposed to work, then I'd call this a bug. If it is not, then please update the documentation (or, ideally, implement this feature).
What is the current behavior?
mongoose.set('autoIndex', false);
has no effect.If the current behavior is a bug, please provide the steps to reproduce.
Sample application:
What is the expected behavior?
tests
collection does not already exist, it should not be created automatically.tests
collection is created automatically.tests
collection does already exist, no new indexes should be added automatically.tests
collection automatically.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Additional Information
According to the documentation for
autoIndex
:However, the documentation for
mongoose.set()
doesn't mentionautoIndex
as a supported settingAlso, in the "Indexes" section of the guide, it lists four ways of setting the property, but none are
mongoose.set()
.The text was updated successfully, but these errors were encountered: