| @@ 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. |
|
| @@ 1495-1508 (lines=14) @@ | ||
| 1492 | * @param array|string $fieldName,... |
|
| 1493 | * @return $this |
|
| 1494 | */ |
|
| 1495 | public function select($fieldName = null) |
|
| 1496 | { |
|
| 1497 | if ( ! isset($this->query['select'])) { |
|
| 1498 | $this->query['select'] = []; |
|
| 1499 | } |
|
| 1500 | ||
| 1501 | $fieldNames = is_array($fieldName) ? $fieldName : func_get_args(); |
|
| 1502 | ||
| 1503 | foreach ($fieldNames as $fieldName) { |
|
| 1504 | $this->query['select'][$fieldName] = 1; |
|
| 1505 | } |
|
| 1506 | ||
| 1507 | return $this; |
|
| 1508 | } |
|
| 1509 | ||
| 1510 | /** |
|
| 1511 | * Select only matching embedded documents in an array field for the query |
|