mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
44 lines
764 B
JavaScript
44 lines
764 B
JavaScript
import Posts from "meteor/nova:posts";
|
|
import Users from "meteor/nova:users";
|
|
|
|
Users.addField([
|
|
/**
|
|
Count of the user's comments
|
|
*/
|
|
{
|
|
fieldName: "commentCount",
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
defaultValue: 0,
|
|
viewableBy: ['guests'],
|
|
}
|
|
}
|
|
]);
|
|
|
|
Posts.addField([
|
|
/**
|
|
Count of the post's comments
|
|
*/
|
|
{
|
|
fieldName: "commentCount",
|
|
fieldSchema: {
|
|
type: Number,
|
|
optional: true,
|
|
defaultValue: 0,
|
|
viewableBy: ['guests'],
|
|
}
|
|
},
|
|
/**
|
|
An array containing the `_id`s of commenters
|
|
*/
|
|
{
|
|
fieldName: "commenters",
|
|
fieldSchema: {
|
|
type: [String],
|
|
optional: true,
|
|
resolveAs: 'commenters: [User]',
|
|
viewableBy: ['guests'],
|
|
}
|
|
}
|
|
]);
|