Is it bad to change _id type in MongoDB to integer?
问题 MongoDB uses ObjectId type for _id. Will it be bad if I make _id an incrementing integer? (With this gem, if you're interested) 回答1: No it isn't bad at all and in fact the built in ObjectId is quite sizeable within the index so if you believe you have something better then you are more than welcome to change the default value of the _id field to whatever. But, and this is a big but , there are some considerations when deciding to move away from the default formulated ObjectId , especially