{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1377","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1377/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1377/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1377/events","html_url":"https://github.com/strongloop/loopback/issues/1377","id":75232698,"number":1377,"title":"Get some fields from MongoDB","user":{"login":"SnehalAmbab","id":11923992,"avatar_url":"https://avatars.githubusercontent.com/u/11923992?v=3","gravatar_id":"","url":"https://api.github.com/users/SnehalAmbab","html_url":"https://github.com/SnehalAmbab","followers_url":"https://api.github.com/users/SnehalAmbab/followers","following_url":"https://api.github.com/users/SnehalAmbab/following{/other_user}","gists_url":"https://api.github.com/users/SnehalAmbab/gists{/gist_id}","starred_url":"https://api.github.com/users/SnehalAmbab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SnehalAmbab/subscriptions","organizations_url":"https://api.github.com/users/SnehalAmbab/orgs","repos_url":"https://api.github.com/users/SnehalAmbab/repos","events_url":"https://api.github.com/users/SnehalAmbab/events{/privacy}","received_events_url":"https://api.github.com/users/SnehalAmbab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-11T14:00:16Z","updated_at":"2015-07-07T00:23:11Z","closed_at":"2015-07-07T00:23:11Z","body":"Hello,\r\n\r\nI want to query some fields from the document of mongodb.\r\nFor eg. I want only name and price field values of product collection which has name, price, sku, attributes as a fields.\r\n\r\nI try to do it with find() function provided by loopback mongodb connector.\r\n\r\nbut it still returns all the fields of the documents.\r\n\r\nMy code is like\r\n\r\nProducts.find({}, {'name':1, 'price':1}, function(err, response) {\r\n});\r\n\r\nwhere \"Products\" is a model object.\r\n\r\nSomeone please help me with this.\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/119033705","html_url":"https://github.com/strongloop/loopback/issues/1377#issuecomment-119033705","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1377","id":119033705,"user":{"login":"superkhau","id":1617364,"avatar_url":"https://avatars.githubusercontent.com/u/1617364?v=3","gravatar_id":"","url":"https://api.github.com/users/superkhau","html_url":"https://github.com/superkhau","followers_url":"https://api.github.com/users/superkhau/followers","following_url":"https://api.github.com/users/superkhau/following{/other_user}","gists_url":"https://api.github.com/users/superkhau/gists{/gist_id}","starred_url":"https://api.github.com/users/superkhau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superkhau/subscriptions","organizations_url":"https://api.github.com/users/superkhau/orgs","repos_url":"https://api.github.com/users/superkhau/repos","events_url":"https://api.github.com/users/superkhau/events{/privacy}","received_events_url":"https://api.github.com/users/superkhau/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T00:23:11Z","updated_at":"2015-07-07T00:23:11Z","body":"Actually I'll just close it. @SnehalAmbab Please reopen if you are still having issues."}}