{"action":"closed","issue":{"url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate/issues/28","repository_url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate","labels_url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate/issues/28/comments","events_url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate/issues/28/events","html_url":"https://github.com/JcBernack/meteor-reactive-aggregate/issues/28","id":236221784,"number":28,"title":"Fetching all documents in collection","user":{"login":"mikkelsjolin","id":1090770,"avatar_url":"https://avatars1.githubusercontent.com/u/1090770?v=3","gravatar_id":"","url":"https://api.github.com/users/mikkelsjolin","html_url":"https://github.com/mikkelsjolin","followers_url":"https://api.github.com/users/mikkelsjolin/followers","following_url":"https://api.github.com/users/mikkelsjolin/following{/other_user}","gists_url":"https://api.github.com/users/mikkelsjolin/gists{/gist_id}","starred_url":"https://api.github.com/users/mikkelsjolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikkelsjolin/subscriptions","organizations_url":"https://api.github.com/users/mikkelsjolin/orgs","repos_url":"https://api.github.com/users/mikkelsjolin/repos","events_url":"https://api.github.com/users/mikkelsjolin/events{/privacy}","received_events_url":"https://api.github.com/users/mikkelsjolin/received_events","type":"User","site_admin":false},"labels":[{"id":302437879,"url":"https://api.github.com/repos/JcBernack/meteor-reactive-aggregate/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-15T15:04:11Z","updated_at":"2017-06-15T17:05:31Z","closed_at":"2017-06-15T17:05:31Z","body":"I'm trying to figure out why my application is fetching all the documents in my collections.\r\n\r\nI have a publication that looks like this:\r\n```\r\nMeteor.publish('location_updates', function(){\r\n\r\n  let pipeline = [\r\n    {\r\n      $match: {\r\n        userId: this.userId\r\n      }\r\n    },\r\n    {\r\n      $sort: {\r\n        'location.timestamp': -1\r\n      }\r\n    },\r\n    {\r\n      $limit: 1\r\n    },\r\n    {\r\n      $project: {\r\n        'location.coords': 1,\r\n        'location.uuid': 1\r\n      }\r\n    }\r\n  ];\r\n\r\n  ReactiveAggregate(this, Location_updates, pipeline);\r\n\r\n});\r\n```\r\n\r\nOn the client-side I'm selecting a single document:\r\n```\r\nthis.subscribe('location_updates');\r\n....\r\nLocation_updates.find({'location.uuid': pos.uuid}, { limit: 1 });\r\n```\r\n\r\nYet in the Galaxy APM I'm seeing this when I load the app:\r\n\r\n![image](https://user-images.githubusercontent.com/1090770/27187710-3103ae5a-51ec-11e7-8081-b8e9cfb33398.png)\r\n\r\nThat's every single document in the **location_updates** collection.\r\n\r\nThe same goes for all my other publications that use ReactiveAggregate."}}
{"actor":{"display_login":"mikkelsjolin"}}