Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
use mongoose expires to remove a ref object id from document

i have 2 schema TokenSchema and DriverSchema :

const tokenSchema: Schema = new Schema({
  token: { type: String, required: true },
  creationDate: { type: Date, required: true, expires: '1m', default: Date.now },
});


const driverSchema: Schema = new Schema({
  drivingLicenseNumber: {
    type: Number,
    required: true,
    unique: true,
  },
  name: { type: String, required: true },
  lastName: { type: String, required: true },
  email: {
    type: String,
    required: true,
    unique: true,
  },
  phone: {
    type: String,
    required: true,
  }, 
  
  password: {
    type: String,
    required: true,
  },
  token: {
    type: Schema.Types.ObjectId,
    ref: 'Token',
  },
});

i need to remove the token id ref from the driver then i remove the token object is that possible ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!