2024-09-08 01:22:22 +01:00
|
|
|
const mongoose = require("mongoose");
|
|
|
|
|
2024-09-08 01:28:21 +01:00
|
|
|
const UrbanDictionarySchema = new mongoose.Schema({
|
2024-09-08 01:22:22 +01:00
|
|
|
term: { type: String, required: true, unique: true, trim: true },
|
|
|
|
definition: { type: String, required: true },
|
|
|
|
example: { type: String, default: "No example provided" },
|
|
|
|
author: { type: String, default: "Unknown" },
|
|
|
|
thumbs_up: { type: Number, default: 0 },
|
|
|
|
thumbs_down: { type: Number, default: 0 },
|
|
|
|
});
|
|
|
|
|
2024-09-08 01:28:21 +01:00
|
|
|
const UrbanDictionary = mongoose.model(
|
|
|
|
"UrbanDictionary",
|
|
|
|
UrbanDictionarySchema
|
|
|
|
);
|
2024-09-08 01:22:22 +01:00
|
|
|
|
2024-09-08 01:28:21 +01:00
|
|
|
module.exports = UrbanDictionary;
|