Something went wrong. Try again.
An Android app for exploring the marine life, featuring local names, detailed profiles, and easy search. One-stop-shop for researchers, hob…
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071const e = require("cors");const mongoose = require("mongoose");const { nanoid } = require("nanoid");
const ItemSchema = new mongoose.Schema( { item_id: { type: String, required: true, unique: true, default: () => nanoid(), }, common_name: { type: String, required: true, }, scientific_name: { type: String, required: true, }, image: { type: String, }, diagram: { type: String, }, description: { type: String, required: true, }, category: { type: String, required: true, enum: ["marine", "freshwater", "brackish"], }, vernacular_names: { type: Array, required: true, default: [], }, more_info: { type: String, required: false, default: "", },
created_by: { type: String, required: true, }, updated_by: { type: String, required: true, },
created_at: { type: Date, required: false, default: Date.now, }, updated_at: { type: Date, required: false, default: Date.now, }, }, { collection: "items" });
module.exports = mongoose.model("item", ItemSchema);