@@ -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