Schema



const AppConfigSchema = new mongoose.Schema({
  type: { type: Schema.Types.Mixed },
  key: { type: String, required: true, unique: true },
  value: { type: Schema.Types.Mixed }
});

const MatchSchema = new Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true } ,
  targetId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  isLiked: { type: Boolean, default: true },
  createdAt: { type: Date },
  updatedAt: { type: Date }
});

const memberShipPlanSchema = new mongoose.Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User' },
  durations: { type: String },
  type: { type: String },
  price: { type: String }
});

const memberShipPurchasesSchema = new mongoose.Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  memberShipPlanTypeId: { type: Schema.Types.ObjectId, ref: 'MemberShipPlan', required: true },
  transactionId: { type: String },
  createdAt: { type: Date }
});

const messageSchema = new Schema({
  text: { type: String, default: '' },
  createdAt: { type: Date, default: Date.now },
  isUnRead: { type: Boolean, default: true },
  senderID: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  receiverID: { type: Schema.Types.ObjectId, ref: 'User', required: true }
});

const otpSchema = new mongoose.Schema({
  phoneNo: { type: String },
  otp: { type: String }
});

const reportSchema = new Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  targetId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  reason: { type: String, default: '' },
  createdAt: { type: Date },
  updatedAt: { type: Date }
});

const spotifySchema = new mongoose.Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  name: { type: String },
  image: { type: String }
});

const unMatchSchema = new Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  targetId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  reason: { type: String, default: '' },
  createdAt: { type: Date },
  updatedAt: { type: Date }
});

const userSchema = new mongoose.Schema(
  {
    active: { type: Boolean, default: true },
    ageRange: { type: [Number], default: [18, 100] },
    averageAge: { type: Number, default: 21.0 },
    coverPicture: { type: String },
    createdAt: { type: Date },
    dailySwipeCount: { type: Number, default: 0 },
    deleted: { type: Boolean, default: false },
    description: { type: String },
    discoverablity: { type: Boolean, default: true },
    distanceUnit: { type: String, default: 'Km' },
    dob: { type: Date, default: '2019-11-11T12:00:36.000Z' },
    deviceId: { type: String },
    devicePlatform: { type: String, enum: ['Ios', 'Android'] },
    email: { type: String },
    firstName: { type: String },
    gender: { type: String, enum: ['Male', 'Female', 'Others'] },
    gpsLoc: {
      type: [Number],
      index: '2d'
    },
    instagram: { type: Boolean, default: false },
    instaPictures: { type: [String] },
    instaUserName: { type: String, default: null },
    jobTitle: { type: String, default: null },
    lastName: { type: String },
    latitude: { type: Number },
    longitude: { type: Number },
    updatedAt: { type: Date },
    name: { type: String },
    notifyMatches: { type: Boolean, default: true },
    notifyMessages: { type: Boolean, default: true },
    oneSignalPlayerId: { type: String, default: null },
    password: { type: String },
    phoneNo: { type: String },
    picturePreferences: { type: [String] },
    profilePicture: { type: String, default: null },
    profileUrl: { type: String },
    role: { type: String, default: 'User' },
    searchDistance: { type: Number, default: 100.0 },
    showMeMale: { type: Boolean, default: true },
    showMeFemale: { type: Boolean, default: true },
    spotify: { type: Boolean, default: false },
    worksAt: { type: String, default: null },
    reports: { type: String },
    reportedBy: { type: String },
    unmatch: { type: String },
    unmatchedBy: { type: String },
    sentMessages: { type: String },
    receivedMessages: { type: String },
    pictures: { type: [String] },
    picturesIds: { type: [String] },
    spotifyData: { type: Schema.Types.ObjectId, ref: 'SpotifyData' },
    proMemberPurchases: { type: Schema.Types.ObjectId, ref: 'MemberShipPurchases' }
  };

const voteSchema = new Schema({
  userId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  targetId: { type: Schema.Types.ObjectId, ref: 'User', required: true },
  isLiked: { type: Boolean },
  isNewMatch: { type: Boolean, default: true },
  createdAt: { type: Date },
  updatedAt: { type: Date }
});

results matching ""

    No results matching ""