CollectionFind::having

(사용 가능한 버전 정보가 없으며 Git에만 있을 수 있음)

CollectionFind::have — 집계 함수에 대한 조건 설정


설명

public mysql_xdevapi\CollectionFind::having(string $sort_expr): mysql_xdevapi\CollectionFind

이 함수는 추출할 문서를 선택하기 위해 'field' 작업 후에 사용할 수 있습니다.


매개변수

sort_expr
유효한 SQL 표현식이어야 하며 집계 함수를 사용할 수 있습니다.

반환 값

추가 처리에 사용할 수 있는 CollectionFind 개체


Examples

예제 #1 mysql_xdevapi\CollectionFind::having() 예제

                  
<?php

//Assuming $coll is a valid Collection object

//Find all the documents for which the 'age' is greather than 40,
//Only the columns 'name' and 'age' are returned in the Result object
$res = $coll->find()->fields(['name','age'])->having('age > 40')->execute();

?>