Skip to content

Commit

Permalink
Add disclaimet to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
khaosdoctor committed Nov 27, 2018
1 parent ee1aeac commit c430fa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/MongodbEventRepository.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ By default, the class already has some base methods:
- `withSession (session: ClientSession)`: Begins a MongoDB session to initiate a transaction (only on Mongo 4.0) and returns an object with the available methods which can be executed within a session. If this following command throws an error, the whole session suffers a rollback, otherwise it is commited.
- `_runPaginatedQuery (query: { [key: string]: any }, page: number, size: number, sort: { [key: string]: 1|-1 } = {})`: Executes a query aplying pagination to the result. Returns an object that follows the [IPaginatedQueryResult](#ipaginatedqueryresult) interface.

> **Note:** `_runPaginatedQuery` should only be used **inside** the child class because it'll return a collection of **documents** and not a collection of **entities**. This harms the principle for entity-first design this repository is all about. In order to create a useful method, please refer to the example below on how to create a `search` method using `_runPaginatedQuery` properly
## Sessions

If your MongoDB version is 4.0 or higher (with transaction support), in order to execute a command using a transaction, follow this example:
Expand Down

0 comments on commit c430fa1

Please sign in to comment.