Skip to content

Commit

Permalink
docs(aggregate): add more info on aggregation changes to upgrade guide
Browse files Browse the repository at this point in the history
We now consolidate all notes on aggregation in to a single location
in the upgrade guide. We also add a note about how `aggregate` no
longer accepts variadic arguments.

Fixes NODE-1285
  • Loading branch information
daprahamian committed Jan 16, 2018
1 parent 5bdbd78 commit 9d12ac3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CHANGES_3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ MongoClient.connect('mongodb://localhost:27017/test', (err, client) => {
});
```

`Collection.prototype.aggregate` now returns a cursor if a callback is provided. It used to return
the resulting documents which is the same as calling `cursor.toArray()` on the cursor we now pass to
the callback.

## Other Changes

Below are more updates to the driver in the 3.0.0 release.
Expand Down Expand Up @@ -177,7 +173,14 @@ in on the options object . Additionally, `find` does not support individual opti
`limit` as positional parameters. You must either pass in these parameters in the `options` object,
or add them via `Cursor` methods like `Cursor.prototype.skip`.

### Aggregation
### `aggregate`

`Collection.prototype.aggregate` no longer accepts variadic arguments. Pipeline stages
are now only accepted as an `Array` of stages as the first argument.

`Collection.prototype.aggregate` now returns a cursor if a callback is provided. It used to return
the resulting documents which is the same as calling `cursor.toArray()` on the cursor we now pass to
the callback.

Support added for `comment` in the aggregation command. Support also added for a `hint` field in the
aggregation `options`.
Expand Down

0 comments on commit 9d12ac3

Please sign in to comment.