downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

MongoDB::getGridFS> <MongoDB::__get
[edit] Last updated: Fri, 24 Feb 2012

view this page in

MongoDB::getDBRef

(PECL mongo >=0.9.0)

MongoDB::getDBRefFetches the document pointed to by a database reference

Descrição

public array MongoDB::getDBRef ( array $ref )

Parâmetros

ref

A database reference.

Valor Retornado

Returns the document pointed to by the reference.

Exemplos

Exemplo #1 MongoDB::getDBRef() example

Example demonstrating how to get a database reference and what the expected input is.

<?php

 $ref 
= array(
   
'$ref' => 'profiles',
   
'$id' => '47cc67093475061e3d9536d2'
 
);
 
 
$profile $db->getDBRef($ref);
 
?>

See MongoDB::createDBRef() for more information about how to programatically create DB references.



add a note add a note User Contributed Notes MongoDB::getDBRef
simon at contribute dot com 18-Sep-2011 11:35
Note, that the $id portion of the array MUST be a MongoId object, otherwise it will fail.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites