BSON type classes and serialization functions

目次

The MongoDB\BSON\Document class

はじめに

Represents a BSON document. This class is used when reading data as raw BSON and cannot be modified.

クラス概要

MongoDB\BSON\Document
final class MongoDB\BSON\Document implements MongoDB\BSON\Type, IteratorAggregate, Serializable {
/* メソッド */
final private __construct()
final static public MongoDB\BSON\Document fromBSON(string $bson)
final static public MongoDB\BSON\Document fromJSON(string $json)
final static public MongoDB\BSON\Document fromPHP(objectarray $value)
final public mixed get(string $key)
final public MongoDB\BSON\Iterator getIterator()
final public bool has(string $key)
final public string serialize()
final public string toCanonicalExtendedJSON()
final public arrayobject toPHP(arraynull $typeMap = null)
final public string toRelaxedExtendedJSON()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.17.0 Implements MongoDB\BSON\Type.

The MongoDB\BSON\PackedArray class

はじめに

Represents a BSON array. This class is used when reading data as raw BSON and cannot be modified.

クラス概要

MongoDB\BSON\PackedArray
final class MongoDB\BSON\PackedArray implements MongoDB\BSON\Type, IteratorAggregate, Serializable {
/* メソッド */
final private __construct()
final static public MongoDB\BSON\PackedArray fromPHP(array $value)
final public mixed get(int $key)
final public MongoDB\BSON\Iterator getIterator()
final public bool has(int $index)
final public string serialize()
final public arrayobject toPHP(arraynull $typeMap = null)
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.17.0 Implements MongoDB\BSON\Type.
PECL mongodb 1.17.0 MongoDB\BSON\PackedArray cannot be serialized in contexts where a BSON document is expected. In earlier versions, the BSON array would have been converted to a document.

The MongoDB\BSON\Iterator class

はじめに

Iterator used to iterate a BSON document or array.

クラス概要

MongoDB\BSON\Iterator
final class MongoDB\BSON\Iterator implements Iterator {
/* メソッド */
final private __construct()
public mixed current()
public stringint key()
public void next()
public void rewind()
public bool valid()
}

The MongoDB\BSON\Binary class

はじめに

BSON type for binary data (i.e. array of bytes). Binary values also have a subtype, which is used to indicate what kind of data is in the byte array. Subtypes from zero to 127 are predefined or reserved. Subtypes from 128-255 are user-defined.

クラス概要

MongoDB\BSON\Binary
final class MongoDB\BSON\Binary implements MongoDB\BSON\BinaryInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* 定数 */
const int MongoDB\BSON\Binary::TYPE_GENERIC = 0;
const int MongoDB\BSON\Binary::TYPE_FUNCTION = 1;
const int MongoDB\BSON\Binary::TYPE_OLD_BINARY = 2;
const int MongoDB\BSON\Binary::TYPE_OLD_UUID = 3;
const int MongoDB\BSON\Binary::TYPE_UUID = 4;
const int MongoDB\BSON\Binary::TYPE_MD5 = 5;
const int MongoDB\BSON\Binary::TYPE_ENCRYPTED = 6;
const int MongoDB\BSON\Binary::TYPE_COLUMN = 7;
const int MongoDB\BSON\Binary::TYPE_SENSITIVE = 8;
const int MongoDB\BSON\Binary::TYPE_USER_DEFINED = 128;
/* メソッド */
final public __construct(string $data, int $type = MongoDB\BSON\Binary::TYPE_GENERIC)
final public string getData()
final public int getType()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

定義済み定数

MongoDB\BSON\Binary::TYPE_GENERIC

Generic binary data.

MongoDB\BSON\Binary::TYPE_FUNCTION

Function.

MongoDB\BSON\Binary::TYPE_OLD_BINARY

Generic binary data (deprecated in favor of MongoDB\BSON\Binary::TYPE_GENERIC).

MongoDB\BSON\Binary::TYPE_OLD_UUID

Universally unique identifier (deprecated in favor of MongoDB\BSON\Binary::TYPE_UUID). When using this type, the Binary's data should be 16 bytes in length.

Historically, other drivers encoded values with this type based on their language conventions (e.g. varying endianness), which makes it non-portable. The PHP driver applies no special handling for encoding or decoding data with this type.

MongoDB\BSON\Binary::TYPE_UUID

Universally unique identifier. When using this type, the Binary's data should be 16 bytes in length and encoded according to » RFC 4122.

MongoDB\BSON\Binary::TYPE_MD5

MD5 hash. When using this type, the Binary's data should be 16 bytes in length.

MongoDB\BSON\Binary::TYPE_ENCRYPTED

Encrypted value. This subtype is used for client-side encryption.

MongoDB\BSON\Binary::TYPE_COLUMN

Column data. This subtype is used for time-series collections.

MongoDB\BSON\Binary::TYPE_SENSITIVE

Sensitive data. This subtype is used for sensitive data that should be excluded from server-side logging when possible.

MongoDB\BSON\Binary::TYPE_USER_DEFINED

User-defined type. While types between 0 and 127 are predefined or reserved, types between 128 and 255 are user-defined and may be used for anything.

変更履歴

バージョン 説明
PECL mongodb 1.17.0 Added MongoDB\BSON\Binary::TYPE_SENSITIVE.
PECL mongodb 1.12.0

Implements Stringable for PHP 8.0+.

Added MongoDB\BSON\Binary::TYPE_COLUMN.

PECL mongodb 1.7.0 Added MongoDB\BSON\Binary::TYPE_ENCRYPTED.
PECL mongodb 1.3.0 Implements MongoDB\BSON\BinaryInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\Decimal128 class

はじめに

BSON type for the » Decimal128 floating-point format, which supports numbers with up to 34 decimal digits (i.e. significant digits) and an exponent range of −6143 to +6144.

Unlike the double BSON type (i.e. float in PHP), which only stores an approximation of the decimal values, the decimal data type stores the exact value. For example, MongoDB\BSON\Decimal128('9.99') has a precise value of 9.99 where as a double 9.99 would have an approximate value of 9.9900000000000002131628….

注意: MongoDB\BSON\Decimal128 is only compatible with MongoDB 3.4+. Attempting to use the BSON type with an earlier version of MongoDB will result in an error.

クラス概要

MongoDB\BSON\Decimal128
final class MongoDB\BSON\Decimal128 implements MongoDB\BSON\Decimal128Interface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string $value)
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0 Implements MongoDB\BSON\Decimal128Interface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\Javascript class

はじめに

BSON type for Javascript code. An optional scope document may be specified that maps identifiers to values and defines the scope in which the code should be evaluated by the server.

注意: This BSON type is mainly used when executing database commands that take a Javascript function as a parameter, such as » mapReduce.

クラス概要

MongoDB\BSON\Javascript
final class MongoDB\BSON\Javascript implements MongoDB\BSON\JavascriptInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string $code, arrayobjectnull $scope = null)
final public string getCode()
final public objectnull getScope()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0 Implements MongoDB\BSON\JavascriptInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\MaxKey class

はじめに

Special BSON type which compares higher than all other possible BSON element values.

注意: This is an internal MongoDB type used for indexing and sharding.

クラス概要

MongoDB\BSON\MaxKey
final class MongoDB\BSON\MaxKey implements MongoDB\BSON\MaxKeyInterface, MongoDB\BSON\Type, Serializable, JsonSerializable {
/* メソッド */
final public __construct()
final public mixed jsonSerialize()
final public string serialize()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.3.0 Implements MongoDB\BSON\MaxKeyInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\MinKey class

はじめに

Special BSON type which compares lower than all other possible BSON element values.

注意: This is an internal MongoDB type used for indexing and sharding.

クラス概要

MongoDB\BSON\MinKey
final class MongoDB\BSON\MinKey implements MongoDB\BSON\MinKeyInterface, MongoDB\BSON\Type, Serializable, JsonSerializable {
/* メソッド */
final public __construct()
final public mixed jsonSerialize()
final public string serialize()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.3.0 Implements MongoDB\BSON\MinKeyInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\ObjectId class

はじめに

BSON type for an » ObjectId. The value consists of 12 bytes, where the first four bytes are a timestamp that reflect the ObjectId's creation. Specifically, the value consists of:

  • a 4-byte value representing the seconds since the Unix epoch,
  • a 5-byte random number unique to a machine and process, and
  • a 3-byte counter, starting with a random value.

In MongoDB, each document stored in a collection requires a unique _id field that acts as a primary key. If an inserted document omits the _id field, the driver automatically generates an ObjectId for the _id field.

Using ObjectIds for the _id field provides the following additional benefits:

  • The creation time of the ObjectId may be accessed using the MongoDB\BSON\ObjectId::getTimestamp method.
  • Sorting on an _id field that stores ObjectId values is roughly equivalent to sorting by creation time.

クラス概要

MongoDB\BSON\ObjectId
final class MongoDB\BSON\ObjectId implements MongoDB\BSON\ObjectIdInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(stringnull $id = null)
final public int getTimestamp()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0

Renamed from MongoDB\BSON\ObjectID to MongoDB\BSON\ObjectId.

Implements MongoDB\BSON\ObjectIdInterface.

PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\Regex class

はじめに

BSON type for a regular expression pattern and optional » flags.

注意: This BSON type is mainly used when querying the database. Alternatively, the » $regex query operator may be used.

クラス概要

MongoDB\BSON\Regex
final class MongoDB\BSON\Regex implements MongoDB\BSON\RegexInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string $pattern, string $flags = "")
final public string getFlags()
final public string getPattern()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0 Implements MongoDB\BSON\RegexInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\Timestamp class

はじめに

Represents a » BSON timestamp, The value consists of a 4-byte timestamp (i.e. seconds since the epoch) and a 4-byte increment.

注意: This is an internal MongoDB type used for replication and sharding. It is not intended for general date storage (MongoDB\BSON\UTCDateTime should be used instead).

クラス概要

MongoDB\BSON\Timestamp
final class MongoDB\BSON\Timestamp implements MongoDB\BSON\TimestampInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(int $increment, int $timestamp)
final public int getIncrement()
final public int getTimestamp()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0 Implements MongoDB\BSON\TimestampInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\UTCDateTime class

はじめに

Represents a » BSON date. The value is a 64-bit integer that represents the number of milliseconds since the Unix epoch (Jan 1, 1970). Negative values represent dates before 1970.

クラス概要

MongoDB\BSON\UTCDateTime
final class MongoDB\BSON\UTCDateTime implements MongoDB\BSON\UTCDateTimeInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(intfloatstringDateTimeInterfacenull $milliseconds = null)
final public mixed jsonSerialize()
final public string serialize()
final public DateTime toDateTime()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.
PECL mongodb 1.3.0 Implements MongoDB\BSON\UTCDateTimeInterface.
PECL mongodb 1.2.0 Implements Serializable and JsonSerializable.

The MongoDB\BSON\Type interface

はじめに

Abstract base interface that should not be implemented directly.

インターフェイス概要

MongoDB\BSON\Type
class MongoDB\BSON\Type {
}

This interface has no methods. Its only purpose is to be the base interface for all BSON type classes.

The MongoDB\BSON\Persistable interface

はじめに

Classes may implement this interface to take advantage of automatic ODM (object document mapping) behavior in the driver. During serialization, the driver will inject a __pclass property containing the PHP class name into the data returned by MongoDB\BSON\Serializable::bsonSerialize. During unserialization, the same __pclass property will then be used to infer the PHP class (independent of any type map configuration) to be constructed before MongoDB\BSON\Unserializable::bsonUnserialize is invoked. See Persisting Data for additional information.

注意: Even if MongoDB\BSON\Serializable::bsonSerialize would return a sequential array, injection of the __pclass property will cause the object to be serialized as a BSON document.

インターフェイス概要

MongoDB\BSON\Persistable
class MongoDB\BSON\Persistable implements MongoDB\BSON\Unserializable, MongoDB\BSON\Serializable {
/* メソッド */
abstract public arraystdClassMongoDB\BSON\Document bsonSerialize()
/* 継承したメソッド */
abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\PackedArray MongoDB\BSON\Serializable::bsonSerialize()
abstract public void MongoDB\BSON\Unserializable::bsonUnserialize(array $data)
}

The MongoDB\BSON\Serializable interface

はじめに

Classes that implement this interface may return data to be serialized as a BSON array or document in lieu of the object's public properties.

インターフェイス概要

MongoDB\BSON\Serializable
class MongoDB\BSON\Serializable implements MongoDB\BSON\Type {
/* メソッド */
abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\PackedArray bsonSerialize()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\Unserializable interface

はじめに

Classes that implement this interface may be specified in a type map for unserializing BSON arrays and documents (both root and embedded).

インターフェイス概要

MongoDB\BSON\Unserializable
class MongoDB\BSON\Unserializable {
/* メソッド */
abstract public void bsonUnserialize(array $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\BinaryInterface interface

はじめに

This interface is implemented by MongoDB\BSON\Binary to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\BinaryInterface
class MongoDB\BSON\BinaryInterface {
/* メソッド */
abstract public string getData()
abstract public int getType()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\Decimal128Interface interface

はじめに

This interface is implemented by MongoDB\BSON\Decimal128 to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\Decimal128Interface
class MongoDB\BSON\Decimal128Interface {
/* メソッド */
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\JavascriptInterface interface

はじめに

This interface is implemented by MongoDB\BSON\Javascript to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\JavascriptInterface
class MongoDB\BSON\JavascriptInterface {
/* メソッド */
abstract public string getCode()
abstract public objectnull getScope()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\MaxKeyInterface interface

はじめに

This interface is implemented by MongoDB\BSON\MaxKey to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\MaxKeyInterface
class MongoDB\BSON\MaxKeyInterface {
}

This interface has no methods.

The MongoDB\BSON\MinKeyInterface interface

はじめに

This interface is implemented by MongoDB\BSON\MinKey to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\MinKeyInterface
class MongoDB\BSON\MinKeyInterface {
}

This interface has no methods.

The MongoDB\BSON\ObjectIdInterface interface

はじめに

This interface is implemented by MongoDB\BSON\ObjectId to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\ObjectIdInterface
class MongoDB\BSON\ObjectIdInterface {
/* メソッド */
abstract public int getTimestamp()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\RegexInterface interface

はじめに

This interface is implemented by MongoDB\BSON\Regex to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\RegexInterface
class MongoDB\BSON\RegexInterface {
/* メソッド */
abstract public string getFlags()
abstract public string getPattern()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\TimestampInterface interface

はじめに

This interface is implemented by MongoDB\BSON\Timestamp to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\TimestampInterface
class MongoDB\BSON\TimestampInterface {
/* メソッド */
abstract public int getIncrement()
abstract public int getTimestamp()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\UTCDateTimeInterface interface

はじめに

This interface is implemented by MongoDB\BSON\UTCDateTime to be used as a parameter, return, or property type in userland classes.

クラス概要

MongoDB\BSON\UTCDateTimeInterface
class MongoDB\BSON\UTCDateTimeInterface {
/* メソッド */
abstract public DateTime toDateTime()
abstract public string __toString()
}

変更履歴

バージョン 説明
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

The MongoDB\BSON\DBPointer class (deprecated)

はじめに

BSON type for the "DBPointer" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON DBPointer type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database.

クラス概要

MongoDB\BSON\DBPointer
final class MongoDB\BSON\DBPointer implements MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.

The MongoDB\BSON\Int64 class

はじめに

BSON type for a 64-bit integer. When decoding BSON to PHP data, this class is used when a 64-bit integer cannot be represented as a PHP integer on 32-bit platforms. These objects support overloaded arithmetic, bitwise, and comparison operators.

When working with raw BSON data through the MongoDB\BSON\Document, MongoDB\BSON\PackedArray, and MongoDB\BSON\Iterator classes, any 64-bit integer will be returned as an instance of this class, regardless of platform and whether the value can be represented as a PHP integer. This ensures that values can be roundtripped without changing the type.

During BSON encoding, objects of this class will convert back to a 64-bit integer type, even when the value would fit in a 32-bit integer. This allows explicitly storing values as 64-bit integers in BSON.

クラス概要

MongoDB\BSON\Int64
final class MongoDB\BSON\Int64 implements MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(intstring $value)
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.16.0 The class can now be instantiated on all platforms. Added support for overloaded arithmetic, bitwise, and comparison operators.
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.

The MongoDB\BSON\Symbol class (deprecated)

はじめに

BSON type for the "Symbol" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON symbol type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database.

クラス概要

MongoDB\BSON\Symbol
final class MongoDB\BSON\Symbol implements MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.

The MongoDB\BSON\Undefined class (deprecated)

はじめに

BSON type for the "Undefined" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON undefined type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database.

クラス概要

MongoDB\BSON\Undefined
final class MongoDB\BSON\Undefined implements MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string $data)
}

変更履歴

バージョン 説明
PECL mongodb 1.12.0 Implements Stringable for PHP 8.0+.