{"action":"closed","issue":{"url":"https://api.github.com/repos/flosse/json-file-store/issues/6","labels_url":"https://api.github.com/repos/flosse/json-file-store/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/flosse/json-file-store/issues/6/comments","events_url":"https://api.github.com/repos/flosse/json-file-store/issues/6/events","html_url":"https://github.com/flosse/json-file-store/issues/6","id":53191962,"number":6,"title":"both save and delete will not check existence of the record","user":{"login":"windmaomao","id":1700809,"avatar_url":"https://avatars.githubusercontent.com/u/1700809?v=3","gravatar_id":"","url":"https://api.github.com/users/windmaomao","html_url":"https://github.com/windmaomao","followers_url":"https://api.github.com/users/windmaomao/followers","following_url":"https://api.github.com/users/windmaomao/following{/other_user}","gists_url":"https://api.github.com/users/windmaomao/gists{/gist_id}","starred_url":"https://api.github.com/users/windmaomao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windmaomao/subscriptions","organizations_url":"https://api.github.com/users/windmaomao/orgs","repos_url":"https://api.github.com/users/windmaomao/repos","events_url":"https://api.github.com/users/windmaomao/events{/privacy}","received_events_url":"https://api.github.com/users/windmaomao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-31T16:43:32Z","updated_at":"2015-06-08T19:56:32Z","closed_at":"2015-06-08T19:56:32Z","body":"so i need to wrap it with get() first. It'll be great if the library can take care for me, so that i can do \r\n\r\n        db.delete(id, function(err) {\r\n            console.log(err);\r\n            if (err) {\r\n                next(err);\r\n            } else {\r\n                res.json({status: \"success\"});\r\n            }\r\n        });\r\n\r\ninstead of \r\n\r\n        db.get(id, function(err, item) {\r\n            if (err) {\r\n                next(err);\r\n            } else {\r\n                db.save(id, item, function(err) {\r\n                    if (err) {\r\n                        next(err);\r\n                    } else {\r\n                        item = db.getSync(id);\r\n                        res.json(_attach_id(item, id));\r\n                    }\r\n                });\r\n            }\r\n        });"}}