These are chat archives for Automattic/mongoose

14th
Oct 2015
Wharley
@wharley
Oct 14 2015 13:46
bom dia,
Gostaria de saber se no populate do mongoose tem como usar um campo sem ser chave ?
good Morning,
I wonder if the populate dto mongoose is to use a field without key?
Wharley
@wharley
Oct 14 2015 14:42
I am grateful for the help
Wharley
@wharley
Oct 14 2015 19:40

I could clarify my doubt and solve my problem, thanks guys
My solution was:

   Model.statics.getByCofins = function (ncm, callback) {
        mongoose.model('Tributacao')
            .findOne()
            .where('ncms').equals(ncm)
            .where('operacao').equals("S")
            .where('uf').equals("BA")
            .populate('imposto', null, {codigo : 4})
            .exec(callback);


    };

It is in line populate
codigo : 4 => Keyless attribute

Valeri Karpov
@vkarpov15
Oct 14 2015 20:52
@whitef0x0 changlog: https://github.com/Automattic/mongoose/blob/master/History.md, migration guide: http://mongoosejs.com/docs/migration.html . Are you getting promises event emitter leaks? Might want to switch out promises libraries because mpromise does some weird things