Created minified URL schema

This commit is contained in:
Daksh Gupta 2022-02-01 00:20:13 +05:30 committed by GitHub
parent 653dd08052
commit 2e57c7d091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import mongoose from 'mongoose';
const { Schema } = mongoose;
//build a schema
const minifiedUrlSchema = new Schema({
originalUrl: {
type: String,
required: true
},
minifiedUrl: {
type: String,
required: true
},
views: {
type: Number
},
createdAt: Number,
updatedAt: Number
});
//make a model using this schema and export it
exports.default = mongoose.model('minified_url_model', minifiedUrlSchema);