2017-09-25 22:09:09 +02:00
|
|
|
const schema = {
|
|
|
|
|
|
|
|
_id: {
|
|
|
|
type: String,
|
|
|
|
viewableBy: ['guests'],
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
The id of the document that was voted on
|
|
|
|
*/
|
2017-09-28 18:15:04 +09:00
|
|
|
documentId: {
|
2017-09-25 22:09:09 +02:00
|
|
|
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;
|