$collection = $this->_getCollection("counters");
$counter = $collection->findAndModify(
array(
"_id" => $name
),
array(
'$inc' => array(
"seq" => 1
)
)
);
return $counter["seq"];
返回的是什么?
__________________________________________后来补充______________________________________________
逻辑是
在counters中查处某个的表名例如(aaa_aaa)的seq
然后将这个表(aaa_aaa)的seq存入该表(aaa_aaa)中的id值
$inc
In mongo, it increases by 1, so the result increases by 1 every timeSeq+1 of the document whose "_id" attribute is $name in the counters collection