Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
两个问题:
调用remove()将删除索引数据,但不会删除索引本身(删除集合会这样做)。因此,当您插入新文档时,它们将被添加到您在remove()调用之前创建的索引中。
remove()
您不需要重新创建索引。创建索引后,它会随着文档的插入/更新/删除而自动更新。