Docs Menu
Docs Home
/ /

MongoDB\Collection::getTypeMap()

Nuevo en la versión 1.2.

MongoDB\Collection::getTypeMap()

Devuelve el mapa de tipos para esta colección.

function getTypeMap(): array

A tipo mapa matriz.

<?php
$collection = (new MongoDB\Client)->getCollection('test', 'users', [
'typeMap' => [
'root' => 'array',
'document' => 'array',
'array' => 'array',
],
]);
var_dump($collection->getTypeMap());

El resultado sería entonces similar a lo siguiente:

array(3) {
["root"]=>
string(5) "array"
["document"]=>
string(5) "array"
["array"]=>
string(5) "array"
}

Volver

obtenerPreferenciaDeLectura()

En esta página