MongoCollection
PHP Manual

MongoCollection::getDBRef

(PECL mongo >=0.9.0)

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

Açıklama

public array MongoCollection::getDBRef ( array $ref )

Değiştirgeler

ref

A database reference.

Dönen Değerler

Returns the database document pointed to by the reference.

Örnekler

Örnek 1 MongoCollection::createDBRef() example

<?php

$playlists 
$db->selectCollection('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";
}

?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

Dazed and Confused
Ma na ma na
Bohemian Rhapsody

Ayrıca Bakınız


MongoCollection
PHP Manual