Overview
MongoDB stores data records as BSON documents. BSON is a binary representation of JSON documents, though it contains more data types than JSON. For the BSON spec, see bsonspec.org.
By default, the MongoDB PHP Library returns BSON documents as MongoDB\Model\BSONDocument objects and BSON arrays as MongoDB\Model\BSONArray objects, respectively.
クラス
MongoDB\Model\BSONArrayこのクラスは、 PHP の ArrayObject クラスを拡張したものです。また、PHP の JsonSerializable インターフェースと、拡張機能の MongoDB\BSON\Serializable および MongoDB\BSON\Unserializable インターフェースも実装されます。
デフォルトでは 、ライブラリはBSON配列をこのクラスのインスタンスとして逆直列化します。BSONおよびJSON の直列化中に、このクラスのインスタンスは配列タイプとして直列化されます( array_values() は、配列を数値的に再インデックス化するために内部的に使用されます)。
MongoDB\Model\BSONDocumentこのクラスは、 PHP の ArrayObject クラスを拡張したものです。また、PHP の JsonSerializable インターフェースと、拡張機能の MongoDB\BSON\Serializable および MongoDB\BSON\Unserializable インターフェースも実装されます。
By default, the library will deserialize BSON documents as instances of this class. During BSON and JSON serialization, instances of this class will serialize as a document type (object casting is used internally).