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

206
Views
Multiple choice questions models for node.js (mongoose)

I'm trying to do a multiple choice question app but I can't figure out how I should create the node.js models using MongoDB(mongoose). For now, I have a Question model that I found from another similar question that I adapted to the recent syntax:

const Schema = mongoose.Schema;
import { AnswerOptionSchema } from './answer-option-schema';

const QuestionSchema = new Schema({
    question: {
        type: String,
        minlength: 10,
        maxlength: 1000,
    },
    answerOptions: {
        type: [AnswerOptionSchema],
        default: undefined,
    }
}, {
    timestamps: true
});

module.exports = Question = mongoose.model('Question', QuestionSchema);

So I try to understand how to create the other models

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!