is createIndexes in mongoose idempotent?
#15463
Replies: 2 comments 1 reply
|
Yes, Under the hood, Mongoose calls MongoDB's Regarding re-indexing: MongoDB does not re-index existing documents when you call Regarding AWS DocumentDB: DocumentDB is MongoDB-compatible and also treats Best practice: It is safe to call |
Uh oh!
There was an error while loading. Please reload this page.
In MongoDB API it seems like calling this API is basically safe as many times as you like since it is idempotent: https://www.mongodb.com/community/forums/t/behavior-of-createindex-for-an-existing-index/2248
But I just wanna confirm that this is also the case for DocumentDB in AWS.
And whether it will try to reindex the existing document again and again if I call this API on a collection with lots of documents.
All reactions