pns
pns

Reputation: 423

Mongodb and indexing

Two questions:

Upvotes: 0

Views: 425

Answers (1)

mdirolf
mdirolf

Reputation: 7651

  1. Calling remove() will remove the indexed data but not the indexes themselves (dropping a collection will do that). So when you insert new documents they will be added to the indexes you created prior to the remove() call.

  2. You don't need to recreate the index. Once you've created an index it will automatically be updated as documents are inserted / updated / removed.

Upvotes: 2

Related Questions