update : 2015.11.03
php.shukuma.com검색:
|
MongoCursor::count(PECL mongo >=0.9.2) MongoCursor::count — Counts the number of results for this query 설명
public int MongoCursor::count
([ bool
$foundOnly = FALSE
] )This method does not affect the state of the cursor: if you haven't queried yet, you can still apply limits, skips, etc. If you have started iterating through results, it will not move the current position of the cursor. If you have exhasted the cursor, it will not reset it. 인수
반환값The number of documents returned by this cursor's query. 예제Example #1 MongoCursor::count() example
<?php 위 예제의 출력 예시: int(3) int(3) int(3) int(2) 오류/예외Throws MongoConnectionException if it cannot reach the database. |