Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Automatic pluralizing collection names #67

Closed
DonKennethVitug opened this issue Oct 31, 2017 · 2 comments
Closed

Automatic pluralizing collection names #67

DonKennethVitug opened this issue Oct 31, 2017 · 2 comments
Labels

Comments

@DonKennethVitug
Copy link

Typegoose automatically pluralizing my collection names. for example my collection is device_warehouse, on the db it became device_warehouses with "s". I hope I can get feedback soon.

@vinczedani
Copy link
Collaborator

vinczedani commented Oct 31, 2017

Hi @DonKennethVitug
This is the default mongoose behaviour. And since Typegoose is built upon mongoose, it works the same.
Cheers,
Daniel

@vinczedani
Copy link
Collaborator

vinczedani commented Nov 22, 2017

Hi @DonKennethVitug
You can pass in the collection name into the schema options like this to enforce mongoose not to pluralise your collection names:


export const device_warehouseModel =
  new device_warehouse().getModelForClass(device_warehouse, {
    schemaOptions: { collection: 'device_warehouse'}
  });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants