These are chat archives for LearnBoost/mongoose

9th
Jan 2015
Ismael Gorissen
@igorissen
Jan 09 2015 12:06
Hi, I keep receiving this error Invalid select() argument. Must be string or object., maybe someone can help me with it. You can find my issue here #2584
Andrew Newdigate
@suprememoocow
Jan 09 2015 12:15
Are you sure your callback is a function?
Ismael Gorissen
@igorissen
Jan 09 2015 12:16
I check that right now
Andrew Newdigate
@suprememoocow
Jan 09 2015 12:18
'cos your example matches the example given in the docs pretty closely:
// assign a function to the "statics" object of our animalSchema
animalSchema.statics.findByName = function (name, cb) {
  this.find({ name: new RegExp(name, 'i') }, cb);
}
Ismael Gorissen
@igorissen
Jan 09 2015 12:20
You found my mistake. I send 3 parameters instead of 4 and the callback is null
Andrew Newdigate
@suprememoocow
Jan 09 2015 12:20
:+1:
Ismael Gorissen
@igorissen
Jan 09 2015 12:21
Thank you for pointing this :smile:
Andrew Newdigate
@suprememoocow
Jan 09 2015 12:21
no prob :)