Help Center> Data Replication Service> User Guide> Check Items> Database Objects> Checking Whether the _Id Fields in the Collection of the Source Database Have Indexes

Checking Whether the _Id Fields in the Collection of the Source Database Have Indexes

MongoDB Database

Table 1 Checking whether the _id fields in the collections of the source database have indexes

Check Item

Whether the _id fields in the collections of the source database have indexes

Description

Check whether the _id fields in the collections of the source database have indexes. If yes, the migration fails.

Alarm Cause and Handling Suggestion

Failure cause: The _id fields in the collections of the source database must have indexes.

Handling suggestions: Run the db.Collection name.ensureIndex({_id: 1}) command to add an index. If the index fails to be added and the system displays a message indicating that the _id value already exists, the collection cannot be migrated.