update : 2015.11.03
php.shukuma.com검색:
|
MongoDB::createDBRef(PECL mongo >=0.9.0) MongoDB::createDBRef — Creates a database reference 설명This method is a flexible interface for creating database refrences (see MongoDBRef). 인수
반환값Returns a database reference array.
If an array without an _id field was provided as the
document_or_id parameter, 예제Example #1 MongoDB::createDBRef() example Example demonstrating how to programatically create a DB reference array from a document.
<?php 위 예제의 출력 예시: Array ( [title] => Test article [description] => Test article description [_id] => MongoId Object ( ) ) Array ( [$ref] => articles [$id] => MongoId Object ( ) ) Now the $ref can be stored on another document and retrieved later with MongoDB::getDBRef() or MongoCollection::getDBRef(). Example #2 MongoDB::createDBRef() example Example demonstrating how to programatically create a DB reference from just an id.
<?php |