MongoCollection::__get
MongoCollection::getIndexInfo
MongoCollection
PHP Manual

# MongoCollection::getDBRef

(PECL mongo >=0.9.0)

MongoCollection::getDBRef — Fetches the document pointed to by a database reference

### Descrição

public array MongoCollection::getDBRef ( array `$ref` )

### Parâmetros

`ref`

  A database reference.

### Valor Retornado

Returns the database document pointed to by the reference.

### Exemplos

Exemplo #1 MongoCollection::getDBRef example

`<?php
$playlists = $db->playlists;
$myList = $playlists->findOne(array('username' => 'me'));
// fetch each song in the playlist
foreach ($myList['songlist'] as $songRef) {
$song = $playlists->getDBRef($songRef);
echo $song['title'] . "\n";
}
?>`

O exemplo acima irá imprimir algo similar a:

    Dazed and Confused
    Ma na ma na
    Bohemian Rhapsody

In the above example each $songRef looks something like the following:

        Array
        (
            [$ref] => songs
            [$id] => 49902cde5162504500b45c2c
        )

### Veja Também

- MongoCollection::createDBRef - Creates a database reference

MongoCollection::__get
MongoCollection::getIndexInfo
MongoCollection
PHP Manual