{"action":"closed","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/3825","labels_url":"https://api.github.com/repos/meteor/meteor/issues/3825/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/3825/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/3825/events","html_url":"https://github.com/meteor/meteor/issues/3825","id":59149002,"number":3825,"title":"Named, But Unsynchronized, Client-Only Collections","user":{"login":"wearhere","id":110000,"avatar_url":"https://avatars.githubusercontent.com/u/110000?v=3","gravatar_id":"","url":"https://api.github.com/users/wearhere","html_url":"https://github.com/wearhere","followers_url":"https://api.github.com/users/wearhere/followers","following_url":"https://api.github.com/users/wearhere/following{/other_user}","gists_url":"https://api.github.com/users/wearhere/gists{/gist_id}","starred_url":"https://api.github.com/users/wearhere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wearhere/subscriptions","organizations_url":"https://api.github.com/users/wearhere/orgs","repos_url":"https://api.github.com/users/wearhere/repos","events_url":"https://api.github.com/users/wearhere/events{/privacy}","received_events_url":"https://api.github.com/users/wearhere/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-26T21:44:58Z","updated_at":"2015-03-03T01:52:33Z","closed_at":"2015-03-03T01:52:33Z","body":"> This is a follow-up to #3627. After talking about that issue with MDG I thought that named, but unsynchronized, client-only collections were supported, just not documented, but I have since found bugs that prevent them from working fully as I would expect.\r\n\r\nI wish to publish a server-side _non-Mongo_ data source e.g. Redis to the client, but–for convenience–let the client manipulate the data using Minimongo. This can be done with the following code:\r\n\r\n```\r\n// On the server.\r\nRedis = new Meteor.RedisCollection('redis');\r\n\r\nMeteor.publish('trackedmessages', function() {\r\n  var self = this;\r\n  var trackedMessagesHandle = Redis.matching('users:jeff:*').observeChanges({\r\n    added: function(key, item) {\r\n      var message = EJSON.parse(item.value);\r\n      self.added('trackedmessages', message._id, message);\r\n    }\r\n  });\r\n  self.ready();\r\n  self.onStop(function() {\r\n    trackedMessagesHandle.stop();\r\n  });\r\n});\r\n\r\n// On the client (in a client-only file).\r\nTrackedMessages = new Mongo.Collection('trackedmessages');\r\n```\r\n\r\n`TrackedMessages` must be named in order to serve as a target of the low-level `added/changed/removed` publication interface, but defining it in a client-only file keeps it from being\r\n defined on the server. I do not wish `TrackedMessages` to be synchronized because the server's data source is not Mongo and the server does not need to monitor changes to the client-side collection.\r\n\r\nThe above code works just fine for publishing data from the server to the client: `TrackedMessages` is populated and can be queried just as I'd expect.\r\n\r\nHowever, `TrackedMessages` cannot be manipulated client-side without triggering (at least) the following bugs:\r\n\r\n1. `TrackedMessages.remove({})` fails with the error \"Untrusted code may only remove documents by ID\". This should not be an error because the `TrackedMessages` is client-side only.\r\n2. `TrackedMessages.remove({ _id: 'some ID' })` fails with the error \"remove failed: Method not found\".\r\n\r\nI am glad to break these bugs out into separate issues. I have not done so because I am pretty sure that they have the same root cause: naming the collection causes Meteor to try to synchronize changes back to the server even though the collection is really client-only.\r\n\r\nThese issues could be addressed in (at least) two ways:\r\n\r\n1. Meteor could make it possible to publish to a client-side only collection without having to name it (and so fooling Meteor into thinking that it should be synchronized).\r\n2. Meteor could somehow detect that the collection wasn't defined on the server."}}