Vulcan/packages/vulcan-voting/lib/modules/votes/schema.js

55 lines
726 B
JavaScript
Raw Normal View History

2017-09-25 22:09:09 +02:00
const schema = {
_id: {
type: String,
viewableBy: ['guests'],
},
/**
The id of the document that was voted on
*/
itemId: {
type: String
},
/**
The id of the document that was voted on
*/
collectionName: {
type: String
},
/**
The id of the user that voted
*/
userId: {
type: String
},
/**
An optional vote type (for Facebook-style reactions)
*/
voteType: {
type: String,
optional: true
},
/**
The vote power (e.g. 1 = upvote, -1 = downvote, or any other value)
*/
power: {
type: Number,
optional: true
},
/**
The vote timestamp
*/
votedAt: {
type: Date,
optional: true
}
};
export default schema;