You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
428 B
JavaScript
27 lines
428 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const UrlSchema = new mongoose.Schema({
|
|
urlId: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
origUrl: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
shortUrl: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
clicks: {
|
|
type: Number,
|
|
required: true,
|
|
default: 0,
|
|
},
|
|
date: {
|
|
type: String,
|
|
default: Date.now,
|
|
},
|
|
});
|
|
|
|
module.exports = mongoose.model('Url', UrlSchema); |