@@ 477-490 (lines=14) @@ | ||
474 | * @param array|string $fieldName,... |
|
475 | * @return $this |
|
476 | */ |
|
477 | public function exclude($fieldName = null) |
|
478 | { |
|
479 | if (! isset($this->query['select'])) { |
|
480 | $this->query['select'] = []; |
|
481 | } |
|
482 | ||
483 | $fieldNames = is_array($fieldName) ? $fieldName : func_get_args(); |
|
484 | ||
485 | foreach ($fieldNames as $fieldName) { |
|
486 | $this->query['select'][$fieldName] = 0; |
|
487 | } |
|
488 | ||
489 | return $this; |
|
490 | } |
|
491 | ||
492 | /** |
|
493 | * Specify $exists criteria for the current field. |
|
@@ 1455-1468 (lines=14) @@ | ||
1452 | * @param array|string $fieldName,... |
|
1453 | * @return $this |
|
1454 | */ |
|
1455 | public function select($fieldName = null) |
|
1456 | { |
|
1457 | if (! isset($this->query['select'])) { |
|
1458 | $this->query['select'] = []; |
|
1459 | } |
|
1460 | ||
1461 | $fieldNames = is_array($fieldName) ? $fieldName : func_get_args(); |
|
1462 | ||
1463 | foreach ($fieldNames as $fieldName) { |
|
1464 | $this->query['select'][$fieldName] = 1; |
|
1465 | } |
|
1466 | ||
1467 | return $this; |
|
1468 | } |
|
1469 | ||
1470 | /** |
|
1471 | * Select only matching embedded documents in an array field for the query |