22 lines
436 B
TypeScript
22 lines
436 B
TypeScript
import { Document, Schema, model } from 'mongoose';
|
|
|
|
export interface FileInterface extends Document {
|
|
name: string,
|
|
identifier: string,
|
|
mimeType: string,
|
|
data: Buffer,
|
|
downloaded: number,
|
|
maxDownloads: number,
|
|
}
|
|
|
|
const File: Schema = new Schema({
|
|
name: String,
|
|
identifier: String,
|
|
mimeType: String,
|
|
data: Buffer,
|
|
downloaded: Number,
|
|
maxDownloads: Number,
|
|
});
|
|
|
|
export default model<FileInterface>('File', File);
|