{"action":"closed","issue":{"url":"https://api.github.com/repos/marklogic/node-client-api/issues/157","labels_url":"https://api.github.com/repos/marklogic/node-client-api/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/marklogic/node-client-api/issues/157/comments","events_url":"https://api.github.com/repos/marklogic/node-client-api/issues/157/events","html_url":"https://github.com/marklogic/node-client-api/issues/157","id":62753649,"number":157,"title":"Reading non-existent document metadata is throwing an error now, it returns an empty array before","user":{"login":"ayuwono","id":7096668,"avatar_url":"https://avatars.githubusercontent.com/u/7096668?v=3","gravatar_id":"","url":"https://api.github.com/users/ayuwono","html_url":"https://github.com/ayuwono","followers_url":"https://api.github.com/users/ayuwono/followers","following_url":"https://api.github.com/users/ayuwono/following{/other_user}","gists_url":"https://api.github.com/users/ayuwono/gists{/gist_id}","starred_url":"https://api.github.com/users/ayuwono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayuwono/subscriptions","organizations_url":"https://api.github.com/users/ayuwono/orgs","repos_url":"https://api.github.com/users/ayuwono/repos","events_url":"https://api.github.com/users/ayuwono/events{/privacy}","received_events_url":"https://api.github.com/users/ayuwono/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/marklogic/node-client-api/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/marklogic/node-client-api/labels/minor","name":"minor","color":"009800"},{"url":"https://api.github.com/repos/marklogic/node-client-api/labels/ship","name":"ship","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"ayuwono","id":7096668,"avatar_url":"https://avatars.githubusercontent.com/u/7096668?v=3","gravatar_id":"","url":"https://api.github.com/users/ayuwono","html_url":"https://github.com/ayuwono","followers_url":"https://api.github.com/users/ayuwono/followers","following_url":"https://api.github.com/users/ayuwono/following{/other_user}","gists_url":"https://api.github.com/users/ayuwono/gists{/gist_id}","starred_url":"https://api.github.com/users/ayuwono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayuwono/subscriptions","organizations_url":"https://api.github.com/users/ayuwono/orgs","repos_url":"https://api.github.com/users/ayuwono/repos","events_url":"https://api.github.com/users/ayuwono/events{/privacy}","received_events_url":"https://api.github.com/users/ayuwono/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/marklogic/node-client-api/milestones/4","html_url":"https://github.com/marklogic/node-client-api/milestones/8.0-2","labels_url":"https://api.github.com/repos/marklogic/node-client-api/milestones/4/labels","id":934497,"number":4,"title":"8.0-2","description":"Fixes targeted for the 8.0-2 release","creator":{"login":"ndw","id":36793,"avatar_url":"https://avatars.githubusercontent.com/u/36793?v=3","gravatar_id":"","url":"https://api.github.com/users/ndw","html_url":"https://github.com/ndw","followers_url":"https://api.github.com/users/ndw/followers","following_url":"https://api.github.com/users/ndw/following{/other_user}","gists_url":"https://api.github.com/users/ndw/gists{/gist_id}","starred_url":"https://api.github.com/users/ndw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndw/subscriptions","organizations_url":"https://api.github.com/users/ndw/orgs","repos_url":"https://api.github.com/users/ndw/repos","events_url":"https://api.github.com/users/ndw/events{/privacy}","received_events_url":"https://api.github.com/users/ndw/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":19,"state":"open","created_at":"2015-01-14T03:11:05Z","updated_at":"2015-03-18T20:48:46Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-03-18T17:44:35Z","updated_at":"2015-03-18T20:48:46Z","closed_at":"2015-03-18T20:48:46Z","body":"Reading non-existent document metadata is throwing an error now, it returns an empty array before\r\n\r\n  it('should fail to read metadata from non-existent document', function(done){\r\n    db.documents.read({\r\n      uris: '/doc/nonExistent.json',\r\n      categories: ['metadata']\r\n      }).\r\n    result(function(response) {\r\n      response.length.should.equal(0);\r\n      done();\r\n    }, function(error) {\r\n      //console.log(error);\r\n      done();\r\n      });\r\n  });\r\n\r\nResult:\r\n<testcase classname=\"Document CRUD negative test\" name=\"should fail to read metadata from non-existent document\" time=\"0\" message=\"Cannot read property 'collections' of null\"><failure classname=\"Docum\r\nent CRUD negative test\" name=\"should fail to read metadata from non-existent document\" time=\"0\" message=\"Cannot read property 'collections' of null\"><![CDATA[TypeError: Cannot read property 'collectio\r\nns' of null\r\n    at collectMetadata (/space/SVN_HOME/HEAD/qa/node-client-api/lib/documents.js:1053:45)\r\n    at Operation.singleReadOutputTransform [as outputTransform] (/space/SVN_HOME/HEAD/qa/node-client-api/lib/documents.js:219:28)\r\n    at Operation.collectBodyObject (/space/SVN_HOME/HEAD/qa/node-client-api/lib/mlrest.js:1350:36)\r\n    at collectPromiseBodyObject (/space/SVN_HOME/HEAD/qa/node-client-api/lib/mlrest.js:590:32)\r\n    at ConcatStream.&lt;anonymous&gt; (/space/SVN_HOME/HEAD/qa/node-client-api/node_modules/concat-stream/index.js:32:43)\r\n    at ConcatStream.emit (events.js:129:20)\r\n    at finishMaybe (/space/SVN_HOME/HEAD/qa/node-client-api/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:460:14)\r\n    at afterWrite (/space/SVN_HOME/HEAD/qa/node-client-api/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:340:3)\r\n    at /space/SVN_HOME/HEAD/qa/node-client-api/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:327:9\r\n    at process._tickCallback (node.js:355:11)]]></failure></testcase>"}}