vadimdemedes / mongorito

🍹 MongoDB ODM for Node.js apps based on Redux
1.38k stars 90 forks source link

Collection name override not working #185

Closed Dids closed 7 years ago

Dids commented 7 years ago

Here's my model

import { Model } from 'mongorito'

class Commit extends Model {
  collection () {
    return 'my_api_commits'
  }
}

module.exports = Commit

It ends up as a collection called commits, so it's like it's not even calling the method.

mbale commented 7 years ago

What if you try it with static collection?

Dids commented 7 years ago

@mbale Could you elaborate on that?

vadimdemedes commented 7 years ago

Confirmed the bug, thanks for reporting!

vadimdemedes commented 7 years ago

https://github.com/vadimdemedes/mongorito/commit/4977e459a0acabc87fdd155875ed07ddd5fb26e1 should fix this.

vadimdemedes commented 7 years ago

Released 3.0.2 with a fix.