在PHP manual,它有这个例子:PHP Mongo问题列表:当replicaSet为true时,_construct返回什么?
<?php
// pass a comma-separated list of server names to the constructor
$m1 = new Mongo("mongodb://sf2.example.com,ny1.example.com", array("replicaSet" => true));
// you only need to pass a single seed, the driver will derive the full list and
// find the master from this seed
$m2 = new Mongo("mongodb://ny1.example.com", array("replicaSet" => true));
?>
- 然而,是什么$ M1回来?
- 如果我想找出主人,并复制,以便主人将负责编写,并且其中一个副本是读取连接,我应该找出&我应该做的最好的方法是什么?
- 我可以拥有不同于每个副本的永久值吗?或者他们必须共享相同的连接通道?
'$ m1'是Mongo类创建的一个对象。它会返回对象本身。 – gunwin 2011-04-06 00:27:10