Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda