{"action":"created","issue":{"url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/14","repository_url":"https://api.github.com/repos/codecapers/mongodb-rest","labels_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/14/comments","events_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/14/events","html_url":"https://github.com/codecapers/mongodb-rest/issues/14","id":106118123,"number":14,"title":"Mongodb dont update doc","user":{"login":"marcoriesco","id":13396828,"avatar_url":"https://avatars.githubusercontent.com/u/13396828?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoriesco","html_url":"https://github.com/marcoriesco","followers_url":"https://api.github.com/users/marcoriesco/followers","following_url":"https://api.github.com/users/marcoriesco/following{/other_user}","gists_url":"https://api.github.com/users/marcoriesco/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoriesco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoriesco/subscriptions","organizations_url":"https://api.github.com/users/marcoriesco/orgs","repos_url":"https://api.github.com/users/marcoriesco/repos","events_url":"https://api.github.com/users/marcoriesco/events{/privacy}","received_events_url":"https://api.github.com/users/marcoriesco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2015-09-12T01:05:29Z","updated_at":"2016-09-15T15:05:38Z","closed_at":null,"body":"\r\n\r\nI am unable to update any field of my project , since moving to MongoDB , I'm using server mongodb-rest REST API.\r\n\r\nMy function send and receive data return , but do not write in mongodb database .\r\n\r\nI would like to help on this.\r\n\r\nI using Restangular, and my code for get and update is:\r\n\r\n$scope.updateItem = function(){\r\n      $http.put(API.db+ '/' +$scope.section+ '/' +$scope.item._id, $scope.item)\r\n        .then(function(response) {\r\n            //var id = getID(response.headers('Location'));\r\n            //$state.go('admin.editItem', {section: $scope.section, id: id});\r\n            console.log(response);\r\n        })\r\n        .catch(function(err, status) {\r\n            toast.msgToast($scope.section + ' ...ocorreu um erro ao criar o item!');\r\n        })\r\n        .finally(function(){\r\n            toast.msgToast($scope.section + ' ...item atualizado!');\r\n        });\r\n\r\n};\r\n\r\n$scope.loadItem = function(){\r\n    ApiRestangular.one($scope.section, $stateParams.id).get().then(function(item) {\r\n        $scope.item = item;\r\n    });\r\n};\r\n\r\n* Sorry , I could not open the previous .."},"comment":{"url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/comments/247355246","html_url":"https://github.com/codecapers/mongodb-rest/issues/14#issuecomment-247355246","issue_url":"https://api.github.com/repos/codecapers/mongodb-rest/issues/14","id":247355246,"user":{"login":"dcohenb","id":1086354,"avatar_url":"https://avatars.githubusercontent.com/u/1086354?v=3","gravatar_id":"","url":"https://api.github.com/users/dcohenb","html_url":"https://github.com/dcohenb","followers_url":"https://api.github.com/users/dcohenb/followers","following_url":"https://api.github.com/users/dcohenb/following{/other_user}","gists_url":"https://api.github.com/users/dcohenb/gists{/gist_id}","starred_url":"https://api.github.com/users/dcohenb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcohenb/subscriptions","organizations_url":"https://api.github.com/users/dcohenb/orgs","repos_url":"https://api.github.com/users/dcohenb/repos","events_url":"https://api.github.com/users/dcohenb/events{/privacy}","received_events_url":"https://api.github.com/users/dcohenb/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T15:05:38Z","updated_at":"2016-09-15T15:05:38Z","body":"I have the same problem,\r\nSimple PUT request using angular's native $http service won't update the document,\r\nHere's my code\r\n\r\n```javascript\r\nlet data = angular.copy(ctrl.element);\r\n$http.put(`%MYSERVER%/mydb/collection/${id}`, data)\r\n     .then(res => alert('changes saved'), err => console.errror(err));\r\n```\r\n\r\ni get the alert \"changes saved\" but the document stays the same\r\n"}}
{"actor":{"display_login":"dcohenb"}}