(PECL mongo >=1.3.0)
MongoClient::selectCollection — 锟斤拷取锟斤拷锟捷匡拷锟斤拷牡锟斤拷锟�
This extension that defines this method is deprecated. Instead, the MongoDB extension should be used. There is no equivalent for this method in the new extension, but there is an alternative in the PHP library:
db
锟斤拷锟捷匡拷锟斤拷
collection
锟侥碉拷锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷一锟斤拷锟铰碉拷锟侥碉拷锟斤拷锟斤拷锟斤拷
锟斤拷锟斤拷锟斤拷菘锟斤拷锟侥碉拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷效锟侥o拷锟阶筹拷 Exception锟斤拷
Example #1 MongoClient::selectCollection() 锟斤拷锟斤拷
<?php
$m = new MongoClient();
$c1 = $m->selectCollection("foo", "bar.baz");
// 锟酵碉拷锟斤拷
$c2 = $m->selectDB("foo")->selectCollection("bar.baz");
// $c1 锟斤拷 $c2 锟斤拷锟节憋拷示锟斤拷锟斤拷同一锟斤拷锟侥碉拷锟斤拷
?>