MongoDB\BSON\Binary::fromVector
(mongodb >=2.2.0)
MongoDB\BSON\Binary::fromVector — Creates a new binary with subtype MongoDB\BSON\Binary::SUBTYPE_VECTOR from the given array and vector type
Description
final public static MongoDB\BSON\Binary::fromVector(array
$vector, MongoDB\BSON\VectorType $vectorType): MongoDB\BSON\BinaryParameters
vector(array)An array of values representing the vector data. The type of each value must match the type indicated by the
vectorTypeparameter:vectorType(MongoDB\BSON\VectorType)The vector data type.
Return Values
Returns a new Binary with subtype MongoDB\BSON\Binary::SUBTYPE_VECTOR.
Errors/Exceptions
- Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
See Also
- MongoDB\BSON\Binary::toArray() - Returns the vector as an array for a Binary with subtype MongoDB\BSON\Binary::SUBTYPE_VECTOR
- MongoDB\BSON\Binary::getVectorType() - Returns the data type for a Binary with the vector subtype
- MongoDB\BSON\VectorType
- » BSON Types
↑ and ↓ to navigate • Enter to select • Esc to close • / to open