Does mongodb reindex if you change the field that it is used in index?
问题 Lets say you have a collection with a field called "primary_key", {"primary_key":"1234", "name":"jimmy", "lastname":"page"} and I have an index on "primary_key". This collection has millions of rows, I want to see how expensive is to change primary_key for one of the records. Does it trigger a reindex of the entire table? or does it just reindex the changed record? in either case is that expensive to do? 回答1: Updating an indexed field in mongodb causes an update of the index (or indices if