In a situation where more than one subscription might be in effect, I’d like to make sure that I only query data from a certain subscription, not among all data that might be currently available for that particular collection and user.
So I thought I’d do something like SELECT field1, field2, "value" as "myXtraField" FROM myTable;
but of course in MongoDb, in my publish function.
That way I could do a simple myCollection.find({myXtraField: "value"})
without the risk that other subscriptions come into play.
I’d like to do that without iterating through the entire query result in the publication.
Yes, I could replicate the query, but I’d prefer not to. Partly because of efficiency and partly because the duplicated code would have to be kept manually in sync until forever.