mizzkey/src/models/poll-vote.ts
2018-11-02 12:49:18 +09:00

16 lines
344 B
TypeScript

import * as mongo from 'mongodb';
import db from '../db/mongodb';
const PollVote = db.get<IPollVote>('pollVotes');
PollVote.createIndex('userId');
PollVote.createIndex('noteId');
export default PollVote;
export interface IPollVote {
_id: mongo.ObjectID;
createdAt: Date;
userId: mongo.ObjectID;
noteId: mongo.ObjectID;
choice: number;
}