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

search for in the

MongoCollection::deleteIndex> <MongoCollection::count
Last updated: Fri, 12 Mar 2010

view this page in

MongoCollection::createDBRef

(PECL mongo >=0.9.0)

MongoCollection::createDBRefCreates a database reference

Description

public array MongoCollection::createDBRef ( array $a )

Parameters

a

Object to which to create a reference.

Return Values

Returns a database reference array.

Examples

Example #1 MongoCollection::createDBRef() example

<?php

$songs 
$db->songs;
$playlists $db->playlists;

// create a reference to a song
$manamana $songs->findOne(array('title' => 'Ma na ma na'));
$refToSong $songs->createDBRef($manamana);

// add the reference to my playlist
$playlists->update(array('username' => 'me'), array('$push' => array('songlist' => $refToSong)));

?>

See Also



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

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