Closed WenyXu closed 3 years ago
Hi @WenyXu Thanks for your PR, but in MongoDB, you can't change the primary key's name.
_id
is a special field in MongoDB. It's a unique identifier for each doc and there is no way you can have a document without it. Even if you are trying to insert the document without it, mongo will create it for you on each document, you can not even modify the _id
field. but you can change its type(e.g., insert as a string instead of ObjectID).
support customizing model PK