@@ 483-496 (lines=14) @@ | ||
480 | * @param array|string $fieldName,... |
|
481 | * @return $this |
|
482 | */ |
|
483 | public function exclude($fieldName = null) |
|
484 | { |
|
485 | if ( ! isset($this->query['select'])) { |
|
486 | $this->query['select'] = []; |
|
487 | } |
|
488 | ||
489 | $fieldNames = is_array($fieldName) ? $fieldName : func_get_args(); |
|
490 | ||
491 | foreach ($fieldNames as $fieldName) { |
|
492 | $this->query['select'][$fieldName] = 0; |
|
493 | } |
|
494 | ||
495 | return $this; |
|
496 | } |
|
497 | ||
498 | /** |
|
499 | * Specify $exists criteria for the current field. |
|
@@ 1491-1504 (lines=14) @@ | ||
1488 | * @param array|string $fieldName,... |
|
1489 | * @return $this |
|
1490 | */ |
|
1491 | public function select($fieldName = null) |
|
1492 | { |
|
1493 | if ( ! isset($this->query['select'])) { |
|
1494 | $this->query['select'] = []; |
|
1495 | } |
|
1496 | ||
1497 | $fieldNames = is_array($fieldName) ? $fieldName : func_get_args(); |
|
1498 | ||
1499 | foreach ($fieldNames as $fieldName) { |
|
1500 | $this->query['select'][$fieldName] = 1; |
|
1501 | } |
|
1502 | ||
1503 | return $this; |
|
1504 | } |
|
1505 | ||
1506 | /** |
|
1507 | * Select only matching embedded documents in an array field for the query |