Hi,
kind of a beginner in MongoDB and I’m running into one issue which might or not be solved by meteor-composite-publish.
I have a collection of events like this:
{category:A, path:A1, content:"", createdAt:"11/10/2015"}
{category:A, path:A1, content:"", createdAt:"11/11/2015"}
{category:A, path:A1, content:"", createdAt:"11/12/2015"}
{category:A, path:A2, content:"", createdAt:"..."}
{category:A, path:A3, content:"", createdAt:"..."}
{category:B, path:B1, content:"", createdAt:"..."}
{category:B, path:B2, content:"", createdAt:"..."}
{category:B, path:B3, content:"", createdAt:"..."}
I want to be able to do 2 things:
-
Publish the latest events created for each path, together; the path are dynamic, so I cannot use a predefined query
In my case should be:{category:A, path:A1, content:"", createdAt:“11/12/2015”}
{category:A, path:A2, content:"", createdAt:"…"}
{category:A, path:A3, content:"", createdAt:"…"}
{category:B, path:B1, content:"", createdAt:"…"}
{category:B, path:B2, content:"", createdAt:"…"}
{category:B, path:B3, content:"", createdAt:"…"} -
Publish the latest events created for a specific category
Probably some kind of aggregation would be nice, but don’t know what to use Any advice for me?