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

search for in the

MongoCollection::getIndexInfo> <MongoCollection::__get
Last updated: Fri, 12 Mar 2010

view this page in

MongoCollection::getDBRef

(PECL mongo >=0.9.0)

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

Description

public array MongoCollection::getDBRef ( array $ref )

Parameters

ref

A database reference.

Return Values

Returns the database document pointed to by the reference.

Examples

Example #1 MongoCollection::createDBRef() 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";
}

?>

The above example will output something similar to:

Dazed and Confused
Ma na ma na
Bohemian Rhapsody

See Also



add a note add a note User Contributed Notes
MongoCollection::getDBRef
There are no user contributed notes for this page.

MongoCollection::getIndexInfo> <MongoCollection::__get
Last updated: Fri, 12 Mar 2010
 
 
show source | credits | sitemap | contact | advertising | mirror sites