28 lines
663 B
JavaScript
28 lines
663 B
JavaScript
|
import mongoose from "mongoose";
|
||
|
|
||
|
const propertySchema = mongoose.Schema({
|
||
|
propertyType: {type: String, required: true },
|
||
|
title: {type: String, required: true },
|
||
|
yearBuild: {type: String, required: true },
|
||
|
totalSqft: {type: String, required: true },
|
||
|
propertyId: String,
|
||
|
creator: String,
|
||
|
createdAt: {
|
||
|
type: Date,
|
||
|
default: new Date(),
|
||
|
},
|
||
|
publishedAt: {
|
||
|
type: Date,
|
||
|
default: new Date(),
|
||
|
},
|
||
|
currentYear: {
|
||
|
type: Number,
|
||
|
default: new Date().getFullYear(),
|
||
|
},
|
||
|
});
|
||
|
|
||
|
|
||
|
const PropertyModal = mongoose.model("property", propertySchema);
|
||
|
|
||
|
export default PropertyModal;
|