Skip to content

Commit cc99f06

Browse files
committed
Document aggregation functionality
1 parent 5fbc340 commit cc99f06

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ MongoDB for XP Framework ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
## 0.5.0 / 2020-08-08
7+
68
* Added new methods `Collection::distinct()` and `Collection::count()`
79
(@thekid)
810
* Added new method `Collection::aggregate()` to perform aggregations, see

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,22 @@ $result= $c->collection('test.products')->update($inc->where(['name' => 'Test'])
6060
Console::writeLine('>> ', $result);
6161
```
6262

63-
6463
Authentication
6564
--------------
6665
To authenticate, pass username and password via the connection string, e.g. `mongodb://user:pass@localhost`. The authentication source defaults to *admin* but can be set by supplying a path, e.g. `mongodb://user:pass@localhost/test`.
6766

6867
Currently, *SCRAM-SHA-1* is the only supported authentication mechanism.
6968

69+
Aggregation
70+
-----------
71+
The `Collection` class also features aggregation methods:
72+
73+
* `count($filter= [])`
74+
* `distinct($key, $filter= [])`
75+
* `aggregate($pipeline)`
76+
77+
See https://docs.mongodb.com/manual/reference/command/nav-aggregation/
78+
7079
Type mapping
7180
------------
7281
All builtin types are mapped to their BSON equivalents. In addition, the following type mappings are used:

0 commit comments

Comments
 (0)