org.springframework.dao.DuplicateKeyException: Bulk write operation error on server localhost:27017. Write errors: [BulkWriteError{index=1, code=11000, message='E11000 duplicate key error collection: test.Test index: _id_ dup key: { : 0 }', details={ }}]. ; nested exception is com.mongodb.MongoBulkWriteException: Bulk write operation error on server localhost:27017. Write errors: [BulkWriteError{index=1, code=11000, message='E11000 duplicate key error collection: test.Test index: _id_ dup key: { : 0 }', details={ }}].
在使用mongodb存数据的时候报错
错误原因:未添加主键id