MongoId::__toString

(PECL mongo >= 0.8.0)

MongoId::__toString锟斤拷锟截革拷 id 十锟斤拷锟斤拷锟狡的憋拷示锟斤拷式

说锟斤拷

public MongoId::__toString ( void ) : string

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷 id锟斤拷

锟斤拷锟斤拷

Example #1 MongoId::__toString() 锟斤拷锟斤拷

<?php

$m 
= new MongoClient();
$collection $m->selectDB("foo")->selectCollection("bar");

$collection->insert(array( "x" => "y" ));
$collection->insert(array( "x" => "y" ));

$cursor $collection->find();
$r1 $cursor->next();
$r2 $cursor->next();

echo 
$r1["_id"] . "\n";
echo 
$r2["_id"] . "\n";

?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

49a7011a05c677b9a916612a
49a702d5450046d3d515d10d