Skip to content

Commit

Permalink
Añadido el id al esquema de la base de datos de las preguntas
Browse files Browse the repository at this point in the history
  • Loading branch information
uo282189 committed Mar 6, 2024
1 parent 6387581 commit 47c5daf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions questionsService/question-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mongoose.connect('mongodb://mongodb:27017/questionsdb', { useNewUrlParser: true,

//preguntas
const preguntaSchema = new mongoose.Schema({

_id: mongoose.Schema.Types.ObjectId,
textoPregunta: {
type: String,
required: true
Expand All @@ -26,7 +26,7 @@ const Pregunta = mongoose.model('Pregunta', preguntaSchema);

//categoria
const categoriaSchema = new mongoose.Schema({

_id: mongoose.Schema.Types.ObjectId,
nombre: {
type: String,
required: true
Expand All @@ -37,7 +37,7 @@ const Categoria = mongoose.model('Categoria', categoriaSchema);

//Respuesta
const respuestaSchema = new mongoose.Schema({

_id: mongoose.Schema.Types.ObjectId,
textoRespuesta: {
type: String,
required: true
Expand All @@ -51,7 +51,7 @@ const Respuesta = mongoose.model('Respuesta', respuestaSchema);

//Tipos
const tiposSchema = new mongoose.Schema({

_id: mongoose.Schema.Types.ObjectId,
idPreguntas: [{
type: String,
required: true
Expand Down

0 comments on commit 47c5daf

Please sign in to comment.