first commit
This commit is contained in:
36
models/peopleInfo.js
Normal file
36
models/peopleInfo.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const peopleInfoSchema = new mongoose.Schema(
|
||||
{
|
||||
mobile: { type: String, required: false, index: true },
|
||||
name: { type: String, required: false, index: true },
|
||||
family: { type: String, required: false, index: true },
|
||||
birthdate: { type: String, required: false },
|
||||
nationalcode: { type: String, required: false, index: true },
|
||||
mellicard: { type: String, required: false },
|
||||
info1: { type: String, required: false },
|
||||
info2: { type: String, required: false },
|
||||
info3: { type: String, required: false },
|
||||
info4: { type: String, required: false },
|
||||
},
|
||||
{ timestamps: false }
|
||||
);
|
||||
|
||||
peopleInfoSchema.index({ nationalcode: 1 });
|
||||
peopleInfoSchema.index({ mobile: 1 });
|
||||
peopleInfoSchema.index({ name: 1, family: 1 });
|
||||
|
||||
peopleInfoSchema.index(
|
||||
{ name: "text", family: "text" },
|
||||
{
|
||||
default_language: "none",
|
||||
weights: { name: 10, family: 10 },
|
||||
}
|
||||
);
|
||||
|
||||
peopleInfoSchema.index({ name: 1 });
|
||||
peopleInfoSchema.index({ family: 1 });
|
||||
|
||||
const PeopleInfo = mongoose.model("PeopleInfo", peopleInfoSchema);
|
||||
|
||||
module.exports = PeopleInfo;
|
||||
Reference in New Issue
Block a user