json-server
json-server copied to clipboard
Add `_is_null` and `_is_not_null` operators
This PR is related to #682 and #823.
- Add
_is_null
and_is_not_null
operators. - Add test cases.
- Update README.
example
db.todos = [
{ id: 1, completeDate: null },
{ id: 2, completeDate: null },
{ id: 3, completeDate: '2022-11-20T13:02:47.210Z' },
{ id: 4, completeDate: '2023-12-05T17:58:17.420Z' },
]
attr_is_null
// GET /todos?completeDate_is_null
[
{ id: 1, completeDate: null },
{ id: 2, completeDate: null }
]
attr_is_not_null
// GET /todos?completeDate_is_not_null
[
{ id: 3, completeDate: '2022-11-20T13:02:47.210Z' },
{ id: 4, completeDate: '2023-12-05T17:58:17.420Z' },
]