{"action":"created","issue":{"url":"https://api.github.com/repos/typicode/json-server/issues/302","repository_url":"https://api.github.com/repos/typicode/json-server","labels_url":"https://api.github.com/repos/typicode/json-server/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/typicode/json-server/issues/302/comments","events_url":"https://api.github.com/repos/typicode/json-server/issues/302/events","html_url":"https://github.com/typicode/json-server/issues/302","id":159331484,"node_id":"MDU6SXNzdWUxNTkzMzE0ODQ=","number":302,"title":"filter does not work","user":{"login":"isatriya","id":5388636,"node_id":"MDQ6VXNlcjUzODg2MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/5388636?v=4","gravatar_id":"","url":"https://api.github.com/users/isatriya","html_url":"https://github.com/isatriya","followers_url":"https://api.github.com/users/isatriya/followers","following_url":"https://api.github.com/users/isatriya/following{/other_user}","gists_url":"https://api.github.com/users/isatriya/gists{/gist_id}","starred_url":"https://api.github.com/users/isatriya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isatriya/subscriptions","organizations_url":"https://api.github.com/users/isatriya/orgs","repos_url":"https://api.github.com/users/isatriya/repos","events_url":"https://api.github.com/users/isatriya/events{/privacy}","received_events_url":"https://api.github.com/users/isatriya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-09T05:34:22Z","updated_at":"2019-10-27T16:33:56Z","closed_at":null,"author_association":"NONE","body":"Hi, \n\ni have a difficulty to use filter. Basically i have mocked-backend.js that the codes look like this:\n`\"use strict\";\n\nconst MOCK_DB_NAME = \"mocked-db.json\";\nconst PORT = 3001;\n\nlet jsonServer = require('json-server');\nlet bodyParser = require('body-parser');\nlet server = jsonServer.create();\nlet router = jsonServer.router(MOCK_DB_NAME);\nlet middlewares = jsonServer.defaults();\n\n// Set default middlewares (logger, static, cors and no-cache)\nserver.use(middlewares);\nserver.use(bodyParser.json());\n\n// require('./mocked-api-routes')(server);\n\n// Use default router\nserver.use(router)\nserver.listen(PORT, () => {\n  console.log(`JSON Server is running on port ${PORT}`);\n})`\n\nand the mocked-db.json as follows :  \n`{\n  \"test-steps\": [\n    {\n      \"test-suite-id\": \"1\",\n      \"test-case-id\": \"1\",\n      \"step-id\": \"71effb21-05f0-437c-b028-cb9a7648d3f1\",\n      \"test-step-sequence\": \"1\",\n      \"action\": \"Dial number\",\n      \"input\": \"123\",\n      \"wait\": \"1\",\n      \"notes\": \"asdf\"\n    },\n    {\n      \"test-suite-id\": \"1\",\n      \"test-case-id\": \"1\",\n      \"step-id\": \"71effb21-05f0-437c-b028-cb9a7648d3f2\",\n      \"test-step-sequence\": \"2\",\n      \"action\": \"Dial number\",\n      \"input\": \"123\",\n      \"wait\": \"1\",\n      \"notes\": \"asdf\"\n    }\n  ]\n}`\n\ni try to filter the mocked-db.json using GET http://localhost:3001/test-steps?test-case-id=1 and it does not work. am i missing something?\n\nthank you.\n"},"comment":{"url":"https://api.github.com/repos/typicode/json-server/issues/comments/546711353","html_url":"https://github.com/typicode/json-server/issues/302#issuecomment-546711353","issue_url":"https://api.github.com/repos/typicode/json-server/issues/302","id":546711353,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NjcxMTM1Mw==","user":{"login":"lukaskane","id":20873299,"node_id":"MDQ6VXNlcjIwODczMjk5","avatar_url":"https://avatars1.githubusercontent.com/u/20873299?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaskane","html_url":"https://github.com/lukaskane","followers_url":"https://api.github.com/users/lukaskane/followers","following_url":"https://api.github.com/users/lukaskane/following{/other_user}","gists_url":"https://api.github.com/users/lukaskane/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaskane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaskane/subscriptions","organizations_url":"https://api.github.com/users/lukaskane/orgs","repos_url":"https://api.github.com/users/lukaskane/repos","events_url":"https://api.github.com/users/lukaskane/events{/privacy}","received_events_url":"https://api.github.com/users/lukaskane/received_events","type":"User","site_admin":false},"created_at":"2019-10-27T16:33:56Z","updated_at":"2019-10-27T16:33:56Z","author_association":"NONE","body":"Have the same problem. But in my case it doesn't work with string values either.\r\n\r\n\r\ndb.json\r\n`tickets: {\r\n  \"0\": {\r\n    \"ID\": \"INC012345103\",\r\n    \"AssignedUser\": null,\r\n    \"Caption\": \"High CPU\",\r\n    \"Description\": null,\r\n    \"Priority\": \"1\",\r\n    \"Project\": \"Project1\",\r\n    \"Status\": null,\r\n    \"Team\": \"blah blah blah\",\r\n    \"LastCallLevel\": \"0\",\r\n    \"CallStatus\": \"Not required\",\r\n    \"LastCallStatus\": \"4\",\r\n    \"LastUpdatedTime\": \"2019-09-19 18:48:43\",\r\n    \"CreatedTime\": \"2019-09-18 18:16:43\"\r\n  },\r\n  \"1\": {\r\n    \"ID\": \"INC012345104\",\r\n    \"AssignedUser\": null,\r\n    \"Caption\": \"High CPU\",\r\n    \"Description\": null,\r\n    \"Priority\": \"1\",\r\n    \"Project\": \"Project2\",\r\n    \"Status\": null,\r\n    \"Team\": \"blah blah blah\",\r\n    \"LastCallLevel\": \"0\",\r\n    \"CallStatus\": \"Not required\",\r\n    \"LastCallStatus\": \"4\",\r\n    \"LastUpdatedTime\": \"2019-09-19 18:48:43\",\r\n    \"CreatedTime\": \"2019-09-15 18:16:43\"\r\n  }\r\n}`\r\n\r\nwhen I'm trying `\"tickets?ID=INC012345103\"` it just returns the whole data, ignoring the condition.\r\n\r\nany clue?\r\n\r\nThanks in advance"}}
{"actor":{"display_login":"lukaskane"}}