Skip to content

Commit

Permalink
Document when life cycle events are called
Browse files Browse the repository at this point in the history
  • Loading branch information
fehmicansaglam committed Jul 7, 2014
1 parent 6ffee93 commit 657b968
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions guide/bsondao.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object PersonDao extends {

### API

* **bulkInsert** Bulk inserts multiple models.
* **bulkInsert** Bulk inserts multiple models. `prePersist` life cycle event is called for each element *before* this function and `postPersist` is called for each element after this function.

```scala
def bulkInsert(
Expand Down Expand Up @@ -162,7 +162,8 @@ def foreach(
sort: BSONDocument = BSONDocument("_id" -> 1))(f: (Model) => Unit): Future[Unit]
```

* **insert** Inserts the given model.
* **insert** Inserts the given model. `prePersist` life cycle event is called *before* this function and `postPersist` is called after this function.


```scala
def insert(model: Model, writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
Expand All @@ -189,13 +190,13 @@ def remove(
def removeAll(writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
```

* **removeById** Removes the document with the given ID.
* **removeById** Removes the document with the given ID. `preRemove` life cycle event is called *before* this function and `postRemove` is called after this function.

```scala
def removeById(id: ID, writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
```

* **save** Inserts the document, or updates it if it already exists in the collection.
* **save** Inserts the document, or updates it if it already exists in the collection. `prePersist` life cycle event is called *before* this function and `postPersist` is called after this function.

```scala
def save(model: Model, writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
Expand Down
10 changes: 6 additions & 4 deletions guide/jsondao.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object PersonDao extends {

### API

* **bulkInsert** Bulk inserts multiple models.
* **bulkInsert** Bulk inserts multiple models. `prePersist` life cycle event is called for each element *before* this function and `postPersist` is called for each element after this function.

```scala
def bulkInsert(
Expand Down Expand Up @@ -159,7 +159,7 @@ def foreach(
sort: JsObject = Json.obj("_id" -> 1))(f: (Model) => Unit): Future[Unit]
```

* **insert** Inserts the given model.
* **insert** Inserts the given model. `prePersist` life cycle event is called *before* this function and `postPersist` is called after this function.

```scala
def insert(model: Model, writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
Expand All @@ -186,13 +186,15 @@ def remove(
def removeAll(writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
```

* **removeById** Removes the document with the given ID.
* **removeById** Removes the document with the given ID. `preRemove` life cycle event is called *before* this function and `postRemove` is called after this function.


```scala
def removeById(id: ID, writeConcern: GetLastError = defaultWriteConcern): Future[LastError]
```

* **save** Inserts the document, or updates it if it already exists in the collection.
* **save** Inserts the document, or updates it if it already exists in the collection. `prePersist` life cycle event is called *before* this function and `postPersist` is called after this function.


```scala
def save(model: Model, writeConcern: GetLastError = GetLastError()): Future[LastError]
Expand Down

0 comments on commit 657b968

Please sign in to comment.