mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
32 lines
661 B
JavaScript
32 lines
661 B
JavaScript
Posts.addField([
|
|
/**
|
|
Count of the post's comments
|
|
*/
|
|
{
|
|
fieldName: "commentCount",
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
public: true
|
|
}
|
|
},
|
|
/**
|
|
An array containing the `_id`s of commenters
|
|
*/
|
|
{
|
|
fieldName: "commenters",
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
public: true,
|
|
join: {
|
|
joinAs: "commentersArray",
|
|
collection: "Users",
|
|
limit: 4
|
|
}
|
|
}
|
|
}
|
|
]);
|
|
|
|
Telescope.utils.addToFields(Posts.publishedFields.list, ["commentCount", "commenters"]);
|
|
Telescope.utils.addToFields(Posts.publishedFields.single, ["commentCount", "commenters"]);
|