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.
UUID を単純な文字列として使用する代わりに、ObjectId を使用する利点は何ですか?
ObjectId はバイナリであるため、使用するスペースが少なくなります。ObjectId には並べ替え要素もあります。最終的には挿入順 (または非常に近い順) になり、一意のままになります。並べ替えは、あるものには適していますが、他のもの (シャード キーなど) には望ましくありません。ObjectId からタイムスタンプ (2 番目の解像度) を抽出することもできます。これは便利です。
それを除けば、大きな違いはないと言えます。