mongodb _id rename
淡淡烟草味
淡淡烟草味 2017-06-16 09:19:03
0
3
1006

I am new to mongodb, how do I rename the _id of an entry?

淡淡烟草味
淡淡烟草味

reply all(3)
typecho

_id is the primary key of mongodb and cannot be renamed.

習慣沉默

_id is automatically generated by mongodb if you do not set it, or you can directly give a value, but as for the renaming mentioned by lz, it seems that it is not possible.

刘奇

Renaming is not possible. If you really want to change the _id, you can try to create a new data and specify the _id, then copy the original data and delete the original data.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template