These are chat archives for Automattic/mongoose

14th
May 2015
Francesco Nero
@francesconero
May 14 2015 08:52
Is there any way to populate all fields without specifying them?
Erinç Fırtına
@EricMcRay
May 14 2015 12:20
@francesconero I think there is not but you can do it with a simple loop.
If you write that code as method you can use it like this: user.populateAll();
Francesco Nero
@francesconero
May 14 2015 12:36
@EricMcRay Thanks!
Erinç Fırtına
@EricMcRay
May 14 2015 12:37
@francesconero anytime. If you need help or detailed info, I am here for while
Valeri Karpov
@vkarpov15
May 14 2015 14:20
Quite a few issues there @mluggy . Can barely read it but alternativeNames should be [{ type: String, trim: true }] and languageIds should be [{ type: String, ref: 'language' }]. Also I'm not sure off the top of my head if { type: [String], index: true } works that way, I'd just explicitly put schema.index({ alternativeNames: 1 });