(PECL mongo >=0.9.0)
MongoCollection::getDBRef — Fetches the document pointed to by a database reference
A database reference.
Returns the database document pointed to by the reference.
Example #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";
}
?>
위 예제의 출력 예시:
Dazed and Confused Ma na ma na Bohemian Rhapsody