In Meteor, I have a collection that the client signs. In some cases, instead of publishing documents that exist in the collection on the server, I want to send some dummy data. Now this is fine using the this.added function in the publication.
My problem is that I want to treat a dummy document as if it were a real document, especially it becomes a problem when I want to update it. For real documents, I run RealDocs.update , but when I perform this action in a dummy document, it fails because there is no representation on the server (and I would like to save it that way).
The collection API, which allowed me to pass something like local = true , would be fantastic, but I have no idea how difficult it is to implement it, and I don't want to change the main code.
Right now I am stuck in creating BogusDocs = new Meteor.Collection(null) , but this makes it difficult to populate the collection, since I have to either use hardcodes in the client code or use a method to get data from the server, and I have to call BogusDocs.update instead of RealDocs.update as soon as I communicate with dummy data.
Perhaps I could really paste the data into the server and make sure it was deleted later, but the data really has nothing to do with the server-side collection, so I would rather avoid this.
Any thoughts on how to approach this problem?
meteor
datacarl
source share