Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
Merge pull request #298 from plexidev/QD-8-Mongoose-automatically-mak…
Browse files Browse the repository at this point in the history
…ing-collection-plurial

Making collection non plurial by default
  • Loading branch information
Zelak312 authored Apr 3, 2023
2 parents f321e58 + b28190d commit 82e2ecf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/drivers/MongoDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ export class MongoDriver implements IDriver {
private models = new Map<string, ReturnType<typeof this.modelSchema>>();
docSchema: mongoose.Schema<CollectionInterface<unknown>>;

public constructor(public url: string, public options: mongoose.ConnectOptions = {}) {
public constructor(public url: string, public options: mongoose.ConnectOptions = {}, pluralize = false) {
this.mongoose = require("mongoose");
if (!pluralize) this.mongoose.pluralize(null);

this.docSchema = new this.mongoose.Schema<CollectionInterface>(
{
ID: {
Expand Down

0 comments on commit 82e2ecf

Please sign in to comment.