Skip to content

Commit

Permalink
Doc for t.ID and t.unique
Browse files Browse the repository at this point in the history
  • Loading branch information
xouabita committed Feb 21, 2016
1 parent 3f61279 commit 46c553f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,26 @@ For **coffeescript**, you can see [`examples`](https://github.com/xouabita/mongo
API
---

### `patch: (Model) -> PatchedModel`
### Mixins

#### `patch: (Model) -> PatchedModel`

The patch function can be useful to combine different Mongorito plugins. It take a class,
extend it then return the extended class.

### Customs tcomb types

#### `t.unique`

It ensure that the type is unique in the database.
**Usage:** `t.unique(T)` where T is any tcomb type

#### `t.ID`

It represent the ID of an element in the database.
**Usage:** `t.ID(M)` where M is a Mongorito model
It ensure that ID is valid and exist in the database

TODOS
-----

Expand All @@ -123,5 +138,5 @@ TODOS
- [x] Add tests for t.ID
- [x] Add example for t.unique
- [x] Add example for t.ID
- [ ] Add docs for t.ID/t.unique
- [x] Add docs for t.ID/t.unique
- [x] Find recursively t.ID/t.unique

0 comments on commit 46c553f

Please sign in to comment.