@@ 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 |
@@ 95-101 (lines=7) @@ | ||
92 | * @param array $fields Fields to return |
|
93 | * @return MongoGridFSCursor A MongoGridFSCursor |
|
94 | */ |
|
95 | public function find(array $query = array(), array $fields = array()) |
|
96 | { |
|
97 | $cursor = new MongoGridFSCursor($this, $this->db->getConnection(), (string)$this, $query, $fields); |
|
98 | $cursor->setReadPreference($this->getReadPreference()); |
|
99 | ||
100 | return $cursor; |
|
101 | } |
|
102 | ||
103 | /** |
|
104 | * Stores a file in the database |