Generally in MongoDB, you would not use an auto-increment pattern for the _id field, or any field, because it does not scale for databases with large numbers of documents. Typically the default value ObjectId is more ideal for the _id.
文档上自己说,not scale for databases with large numbers of documents,自增的不适合有大数量documents的数据库
id的问题
时间: 2024-10-19 11:39:11