{"action":"closed","issue":{"url":"https://api.github.com/repos/webix-hub/webix-remote-js/issues/3","repository_url":"https://api.github.com/repos/webix-hub/webix-remote-js","labels_url":"https://api.github.com/repos/webix-hub/webix-remote-js/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/webix-hub/webix-remote-js/issues/3/comments","events_url":"https://api.github.com/repos/webix-hub/webix-remote-js/issues/3/events","html_url":"https://github.com/webix-hub/webix-remote-js/issues/3","id":168224374,"number":3,"title":"Mongo DB Async callback wont return values","user":{"login":"mininggold","id":19657064,"avatar_url":"https://avatars.githubusercontent.com/u/19657064?v=3","gravatar_id":"","url":"https://api.github.com/users/mininggold","html_url":"https://github.com/mininggold","followers_url":"https://api.github.com/users/mininggold/followers","following_url":"https://api.github.com/users/mininggold/following{/other_user}","gists_url":"https://api.github.com/users/mininggold/gists{/gist_id}","starred_url":"https://api.github.com/users/mininggold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mininggold/subscriptions","organizations_url":"https://api.github.com/users/mininggold/orgs","repos_url":"https://api.github.com/users/mininggold/repos","events_url":"https://api.github.com/users/mininggold/events{/privacy}","received_events_url":"https://api.github.com/users/mininggold/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-29T00:08:36Z","updated_at":"2016-07-29T02:42:43Z","closed_at":"2016-07-29T02:42:43Z","body":"\r\n//This code works using Express.js with REST API \r\n// Create new record, write data to Mongo DB collection (dbCollection)\r\napp.post('/api/tags', function(req, res){\r\n\tconsole.log('22222');\r\n\tconsole.log(req.body);\r\n\tdbCollection.insert(req.body, function(err, record){\r\n\t  if (err) return res.send({ status:\"error\" });\r\n    res.send({ newid:req.body._id });\r\n  });\r\n});\r\n\r\n//This code does not work because of the callback for dbCollection.insert()\r\napi.setMethod(\"add\", function(a){\r\n\tdbCollection.insert(a, function(err, record){\r\n\t\tif (err) {\r\n\t\t\treturn 'error';\r\n\t\t  } else {\r\n\t\t\treturn 'success';\r\n\t\t}\t\r\n});\r\n\r\nIs it possible to use Synchronize to convert the dbCollection async to a sync method?\r\nsee: https://coderwall.com/p/5okc9g/eliminating-callback-hell-in-node-js-with-synchronize\r\nor: http://alexeypetrushin.github.io/synchronize/docs/index.html\r\n\r\nWhat other options are there to make Webix Remote work with async database callbacks?\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"mininggold"}}