略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoDB::getDBRef

2024-11-13

MongoDB::getDBRef

(PECL mongo >=0.9.0)

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

说明

public MongoDB::getDBRef ( array $ref ) : array

参数

ref

A database reference.

返回值

Returns the document pointed to by the reference.

范例

Example #1 MongoDB::getDBRef() example

Example demonstrating how to get a database reference and what the expected input is.

<?php

 $ref 
= array(
   
'$ref' => 'profiles',
   
'$id' => new MongoId('47cc67093475061e3d9536d2')
 );
 
 
$profile $db->getDBRef($ref);
 
?>

See MongoDB::createDBRef() for more information about how to programatically create DB references.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongodb.getdbref.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3