Two questions:
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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.