{
_id:ObjectId,
otherID:String
}
{
_id:ObjectId,
OtherID:ObjectId
}
What’s the difference?
曾经蜡笔没有小新2017-05-02 09:27:26
Please use ObjectId, various operations are more convenient than strings
过去多啦不再A梦2017-05-02 09:27:26
I have made a more comprehensive explanation about ObjectId, you can refer to the article.
If you don’t want to read it all, the answer to this question is in the Q&A section at the end.
PHP中文网2017-05-02 09:27:26
ObjectId is easier to generate in a sharded environment... and the default _id key is an ObjectId object..