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

163
Vistas
Getter/Setter Mongoose FeathersJS on get or find

When using getter or setter in a mongoose schema, it is only call on create. It's the same for a transform function in toJSON or toObject in schema options. On a get or find there is no console.log()

const schema = new Schema({
    imageId: {
      type: String,
      get: (v) => {
        console.log('Here');
        return v;
      }
    },
  }, {
    timestamps: true
    toJSON: {
      transform: (doc, ret, options) => {
        console.log('Here too');
      }
    }
    }
  });

Do you know how make them work on get and find ?

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When using Mongoose model properties the lean service option needs to be set to false.

about 4 years ago · Juan Pablo Isaza Denunciar
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