MongoDB::selectCollection
(PECL mongo >=0.9.0)
MongoDB::selectCollection — Gets a collection
说明
参数
-
name
-
The collection name.
返回值
Returns a new collection object.
错误/异常
Throws Exception if the collection name is invalid.

User Contributed Notes 1 note
asuquo dot ulo at techxion dot com ¶
4 years ago
A simple script that selects a db and collection.
$m = new MongoClient();
echo "Connection to database successfully<br>";
// select a database
$db = $m->test;
echo "Database test selected<br>";
//select a Collection
$collection = $db->selectCollection("member");
echo "Collection member selected succsessfully<br>";
?>
备份地址:http://www.lvesu.com/blog/php/mongodb.selectcollection.php