{"info":{"_postman_id":"e017723a-ef0c-4d69-9579-24650c8b7dc4","name":"Todo Sort and Search","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"8028791","collectionId":"e017723a-ef0c-4d69-9579-24650c8b7dc4","publishedId":"Szmk2GP8","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-05-16T13:15:52.000Z"},"item":[{"name":"Search by a task","id":"b2f7a6b0-f6ea-4655-924c-35dda2520cc1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/todo?search=Pick","description":"<p>Search to-dos by a task, default sorted by alphabetically. We can sort inverse by setting a param as -1.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","todo"],"host":["localhost"],"query":[{"key":"search","value":"Pick"}],"variable":[]}},"response":[{"id":"a4a01b90-517b-4524-899c-5db8deef0cbd","name":"Search by a task","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/todo?search=Charge","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","todo"],"query":[{"key":"search","value":"Charge"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"319"},{"key":"ETag","value":"W/\"13f-MQa3Bn9tZqKlsWc5eheqHlOPbL0\""},{"key":"Date","value":"Sat, 16 May 2020 12:29:24 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"statusCode\": 200,\n    \"paging\": {\n        \"currentPage\": 1,\n        \"pageLimit\": 10,\n        \"totalPages\": 1\n    },\n    \"message\": \"All todo\",\n    \"data\": [\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd1136dea4c362ce20785\",\n            \"task\": \"Charge my phone\",\n            \"updatedAt\": \"2020-05-16T11:40:03.198Z\",\n            \"createdAt\": \"2020-05-16T11:40:03.198Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"b2f7a6b0-f6ea-4655-924c-35dda2520cc1"},{"name":"Sort by a date","id":"7087a435-e318-4d74-bcd3-911695eff25e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/todo?sort=date&a=1","description":"<p>Search to-dos by a date, default sorted by date of creation. We can sort inverse by setting a param as -1.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","todo"],"host":["localhost"],"query":[{"key":"sort","value":"date"},{"key":"a","value":"1"}],"variable":[]}},"response":[{"id":"fb2ef1ef-3ea6-4a3f-9bdd-65e8c4ffc987","name":"Sort by a date","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/todo?sort=date&a=1","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","todo"],"query":[{"key":"sort","value":"date"},{"key":"a","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"959"},{"key":"ETag","value":"W/\"3bf-iIoB57OpyfFFGbSAi/1zwYOUTI4\""},{"key":"Date","value":"Sat, 16 May 2020 12:29:57 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"statusCode\": 200,\n    \"paging\": {\n        \"currentPage\": 1,\n        \"pageLimit\": 10,\n        \"totalPages\": 1\n    },\n    \"message\": \"All todo sorted by date\",\n    \"data\": [\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": false,\n            \"priority\": 5,\n            \"_id\": \"5ebf93cd252af932b47ed302\",\n            \"task\": \"Buy eggs\",\n            \"updatedAt\": \"2020-05-16T07:18:37.948Z\",\n            \"createdAt\": \"2020-05-16T07:18:37.948Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebf9468252af932b47ed304\",\n            \"task\": \"Buy milk\",\n            \"updatedAt\": \"2020-05-16T12:25:07.687Z\",\n            \"createdAt\": \"2020-05-16T07:21:12.829Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd1136dea4c362ce20785\",\n            \"task\": \"Charge my phone\",\n            \"updatedAt\": \"2020-05-16T11:40:03.198Z\",\n            \"createdAt\": \"2020-05-16T11:40:03.198Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"WORK\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd73b4ebe7d4ba474cf61\",\n            \"task\": \"Complete an API\",\n            \"updatedAt\": \"2020-05-16T12:06:19.588Z\",\n            \"createdAt\": \"2020-05-16T12:06:19.588Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"7087a435-e318-4d74-bcd3-911695eff25e"},{"name":"Sort by a label","id":"9281b0f2-4f90-4c95-b9f1-2effe8d5f3d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/todo?sort=label&a=1","description":"<p>Search to-dos by a label, default sorted by alphabetically. We can sort inverse by setting a param as -1.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","todo"],"host":["localhost"],"query":[{"key":"sort","value":"label"},{"key":"a","value":"1"}],"variable":[]}},"response":[{"id":"84c0fe43-e8ec-4baf-8558-0aa94f4db0ae","name":"Sort by a label","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/todo?sort=label&a=1","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","todo"],"query":[{"key":"sort","value":"label"},{"key":"a","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"968"},{"key":"ETag","value":"W/\"3c8-3OcDsDuYHz3VqJDqtw8zZ8HX0uQ\""},{"key":"Date","value":"Sat, 16 May 2020 12:13:09 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"statusCode\": 200,\n    \"paging\": {\n        \"currentPage\": 1,\n        \"pageLimit\": 10,\n        \"totalPages\": 1\n    },\n    \"message\": \"All todo sorted by label\",\n    \"data\": [\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": false,\n            \"priority\": 5,\n            \"_id\": \"5ebf93cd252af932b47ed302\",\n            \"task\": \"Buy eggs\",\n            \"updatedAt\": \"2020-05-16T07:18:37.948Z\",\n            \"createdAt\": \"2020-05-16T07:18:37.948Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebf9468252af932b47ed304\",\n            \"task\": \"Pick up childern\",\n            \"updatedAt\": \"2020-05-16T07:21:12.829Z\",\n            \"createdAt\": \"2020-05-16T07:21:12.829Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd1136dea4c362ce20785\",\n            \"task\": \"Charge my phone\",\n            \"updatedAt\": \"2020-05-16T11:40:03.198Z\",\n            \"createdAt\": \"2020-05-16T11:40:03.198Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"WORK\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd73b4ebe7d4ba474cf61\",\n            \"task\": \"Complete an API\",\n            \"updatedAt\": \"2020-05-16T12:06:19.588Z\",\n            \"createdAt\": \"2020-05-16T12:06:19.588Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"9281b0f2-4f90-4c95-b9f1-2effe8d5f3d6"},{"name":"Sort by priority","id":"5521b8b8-4abf-40af-ba85-bd532c1221fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/todo?sort=priority&a=1","description":"<p>Search to-dos by a priority, default sorted by priority. We can sort inverse by setting a param as -1.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","todo"],"host":["localhost"],"query":[{"key":"sort","value":"priority"},{"key":"a","value":"1"}],"variable":[]}},"response":[{"id":"43ed963c-52e3-4417-b0db-60251fa21c50","name":"Sort by a priority","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/todo?sort=priority&a=1","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","todo"],"query":[{"key":"sort","value":"priority"},{"key":"a","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"971"},{"key":"ETag","value":"W/\"3cb-87ro56tIEMEMC9sC5RO2te+jMHw\""},{"key":"Date","value":"Sat, 16 May 2020 12:22:03 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"statusCode\": 200,\n    \"paging\": {\n        \"currentPage\": 1,\n        \"pageLimit\": 10,\n        \"totalPages\": 1\n    },\n    \"message\": \"All todo sorted by priority\",\n    \"data\": [\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebf9468252af932b47ed304\",\n            \"task\": \"Pick up childern\",\n            \"updatedAt\": \"2020-05-16T07:21:12.829Z\",\n            \"createdAt\": \"2020-05-16T07:21:12.829Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd1136dea4c362ce20785\",\n            \"task\": \"Charge my phone\",\n            \"updatedAt\": \"2020-05-16T11:40:03.198Z\",\n            \"createdAt\": \"2020-05-16T11:40:03.198Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"WORK\",\n            \"progress\": \"NEW\",\n            \"isImportant\": true,\n            \"priority\": 1,\n            \"_id\": \"5ebfd73b4ebe7d4ba474cf61\",\n            \"task\": \"Complete an API\",\n            \"updatedAt\": \"2020-05-16T12:06:19.588Z\",\n            \"createdAt\": \"2020-05-16T12:06:19.588Z\",\n            \"__v\": 0\n        },\n        {\n            \"label\": \"PERSONAL\",\n            \"progress\": \"NEW\",\n            \"isImportant\": false,\n            \"priority\": 5,\n            \"_id\": \"5ebf93cd252af932b47ed302\",\n            \"task\": \"Buy eggs\",\n            \"updatedAt\": \"2020-05-16T07:18:37.948Z\",\n            \"createdAt\": \"2020-05-16T07:18:37.948Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"5521b8b8-4abf-40af-ba85-bd532c1221fa"}],"event":[{"listen":"prerequest","script":{"id":"39ec5b41-ab07-497c-994a-e05defa56153","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"2a0ffa92-5156-47ab-8790-64cf729082ab","type":"text/javascript","exec":[""]}}]}