@@ 323-329 (lines=7) @@ | ||
320 | * @param array $fields Fields of the results to return. |
|
321 | * @return MongoCursor |
|
322 | */ |
|
323 | public function find(array $query = [], array $fields = []) |
|
324 | { |
|
325 | $cursor = new MongoCursor($this->db->getConnection(), (string)$this, $query, $fields); |
|
326 | $cursor->setReadPreference($this->getReadPreference()); |
|
327 | ||
328 | return $cursor; |
|
329 | } |
|
330 | ||
331 | /** |
|
332 | * Retrieve a list of distinct values for the given key across a collection |
@@ 94-100 (lines=7) @@ | ||
91 | * @param array $fields Fields to return |
|
92 | * @return MongoGridFSCursor A MongoGridFSCursor |
|
93 | */ |
|
94 | public function find(array $query = array(), array $fields = array()) |
|
95 | { |
|
96 | $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string)$this, $query, $fields); |
|
97 | $cursor->setReadPreference($this->getReadPreference()); |
|
98 | ||
99 | return $cursor; |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * Stores a file in the database |