| @@ 377-383 (lines=7) @@ | ||
| 374 | * @param array $fields Fields of the results to return. |
|
| 375 | * @return MongoCursor |
|
| 376 | */ |
|
| 377 | public function find(array $query = array(), array $fields = array()) |
|
| 378 | { |
|
| 379 | $cursor = new MongoCursor($this->db->getConnection(), (string)$this, $query, $fields); |
|
| 380 | $cursor->setReadPreference($this->getReadPreference()); |
|
| 381 | ||
| 382 | return $cursor; |
|
| 383 | } |
|
| 384 | ||
| 385 | /** |
|
| 386 | * Retrieve a list of distinct values for the given key across a collection |
|
| @@ 92-98 (lines=7) @@ | ||
| 89 | * @param array $fields Fields to return |
|
| 90 | * @return MongoGridFSCursor A MongoGridFSCursor |
|
| 91 | */ |
|
| 92 | public function find(array $query = array(), array $fields = array()) |
|
| 93 | { |
|
| 94 | $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string)$this, $query, $fields); |
|
| 95 | $cursor->setReadPreference($this->getReadPreference()); |
|
| 96 | ||
| 97 | return $cursor; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Stores a file in the database |
|