Closed shamim4063 closed 7 years ago
My Schema Model like following:
import mongoose from 'mongoose'; import mongooseIntl from 'mongoose-intl'; import config from '../../../config/config.json'; var intlOptions = { languages: config.ALLOWED_LANGUAGES, // ["en", "bn"] defaultLanguage: config.DEFAULT_LANGUAGE // "en" } mongoose.plugin(mongooseIntl, intlOptions); let authorSchema = new mongoose.Schema({ name: { type: String, requiredAll: true, intl: true }, description: { type: String, intl: true } }, { toJSON: { virtuals: true } }); export default mongoose.model('Author', authorSchema);
I want to execute following query:
Author.setDefaultLanguage("bn"); Author.find() .select({ name :1}) .exec((err, author)=>{ if(err){ res.send(err) } res.json(author) }); })
But it is not working. Without select block work perfectly.
Thank you for reporting on this. The bugfix was published as v2.0.1
My Schema Model like following:
I want to execute following query:
But it is not working. Without select block work perfectly.