Skip to content

Instantly share code, notes, and snippets.

@hrishi7
Created July 17, 2020 11:01
Show Gist options
  • Save hrishi7/89f322d9fef19181ffb8e4c925a52eb3 to your computer and use it in GitHub Desktop.
Save hrishi7/89f322d9fef19181ffb8e4c925a52eb3 to your computer and use it in GitHub Desktop.
// let timeline = await Timeline.aggregate([
// { $match: { timelineTopic: timelineTopic } },
// {
// $group: {
// _id: "$date",
// shortDescription: { $addToSet: "$shortDescription" },
// longDescription: { $addToSet: "$longDescription" },
// articles: {
// $push: "$article",
// },
// },
// },
// { $unwind: "$shortDescription" },
// { $unwind: "$longDescription" },
// {
// $project: {
// _id: 1,
// date: "$_id",
// shortDescription: 1,
// longDescription: 1,
// timelineTopic: 1,
// articles: 1,
// },
// },
// ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment