Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Mongodb にデータを挿入すると、現在のタイムスタンプを持つ一意の値が _id フィールドに作成されますが、独自のタイムスタンプを持つ一意の値を _id フィールドに挿入したいと考えています。私はこれを行うことができますか?
デフォルトでは、MongoDB ドライバー (公式にサポートされているドライバー) は、_idフィールドをObjectId特殊なデータ型である に設定します。これをオーバーライドしたい場合は、_idフィールドを好きな値を持つデータ型に設定できます。
_id
ObjectId
参照