Trump Nhân

8 bundles
1 filea month ago
1

const mongoose = require("mongoose");

123456789101112131415161718192021222324252627282930313233343536373839404142
const mongoose = require("mongoose"); import { Schema } from "mongoose"; const customerTokenSchema = new mongoose.Schema( { customer: { type: Schema.Types.ObjectId, ref: "customer", }, token: { type: String, unique: true, required: true, }, ip: { type: String, }, isActivated: { type: Boolean, default: true, }, lastTime: { type: Date, default: Date.now(), }, }, { timestamps: { createdAt: "createdAt", updatedAt: "updatedAt", }, } ).index({ token: "text", }); const CustomerToken = mongoose.model( "customerToken", customerTokenSchema, "customerToken" ); export default CustomerToken;