Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

Commit cb2da4b

Browse files
committed
docs(readme): Documents defaults.
1 parent 49c0fed commit cb2da4b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

readme.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,24 @@ const todosFacade = factory<TodoEntity>({
3333
dbName: 'todoapp',
3434
url: 'mongodb://localhost:27017',
3535
}),
36+
// Optional property to convert an entity to a DB document. Defaults to "utils/constructIdDocument".
3637
constructDocument: ({ id, ...patch}) => {
37-
// Optional property that converts an entity to a document for the database.
3838
return { _id: id, ...patch };
3939
},
40+
// Optional property to convert a DB document to an entity. Defaults to "utils/constructIdEntity".
4041
constructEntity: ({ _id, ...document }) => {
41-
// Optional property that converts a document from the database to an entity.
4242
return { id: _id, ...document };
4343
},
44+
// Optional property to convert an entity filter to a DB filter. Defaults to "utils/parseFilterId".
4445
constructFilter: (filter) => {
45-
// Optional property that converts an entity filter to a filter for the DB.
4646
return parseFilterId(filter);
4747
},
48+
// Optional property to convert an entity sort to a DB sort. Defaults to "utils/renameSortId".
4849
constructSort: (sort) => {
49-
// Optional property that converts an entity sort to a sort for the DB.
5050
return renameSortId(sort);
5151
}.
52-
defaultPaginationLimit: 100, // Optional property.
52+
// Optional property. Defaults to 100.
53+
defaultPaginationLimit: 100,
5354
entityName: 'todo',
5455
});
5556
```

0 commit comments

Comments
 (0)