--
This commit is contained in:
parent
3cd5d356cb
commit
25f973e2b3
37 changed files with 812 additions and 470 deletions
|
|
@ -0,0 +1,17 @@
|
|||
import mongoose, { Document, Schema, Types } from 'mongoose'
|
||||
import shortid from 'shortid'
|
||||
|
||||
const UrlSchema: Schema = new Schema({
|
||||
_id: {
|
||||
type: String,
|
||||
default: shortid.generate
|
||||
},
|
||||
url: String
|
||||
})
|
||||
|
||||
export type UrlModel = Document & {
|
||||
_id: string,
|
||||
url: string
|
||||
}
|
||||
|
||||
export default mongoose.model<UrlModel>('urls', UrlSchema, 'urls')
|
||||
Loading…
Reference in a new issue