Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the 'connection' object of 'mongoose' #46

Open
CodePirate7 opened this issue Nov 18, 2019 · 8 comments
Open

How do I get the 'connection' object of 'mongoose' #46

CodePirate7 opened this issue Nov 18, 2019 · 8 comments

Comments

@CodePirate7
Copy link

CodePirate7 commented Nov 18, 2019

I want to use some plugins in mongoose, but the plugins need a 'connection' object. How do I get it?

@andreialecu
Copy link

I was able to get the connection with:

import { getConnectionToken } from 'nestjs-typegoose';

@Injectable()
export class MyService {
  constructor(
    ...
    @Inject(getConnectionToken()) private connection: mongoose.Connection,
    ...
  ) {}
}

@nasr18
Copy link

nasr18 commented Feb 5, 2020

@q389491729 which plugin you are talking about? mongoose-auto-increment plugin?

@CodePirate7
Copy link
Author

CodePirate7 commented Feb 5, 2020 via email

@nasr18
Copy link

nasr18 commented Feb 5, 2020

@q389491729 is that plugin working with nestjs?

@CodePirate7
Copy link
Author

CodePirate7 commented Feb 5, 2020 via email

@nasr18
Copy link

nasr18 commented Feb 5, 2020

Did you made it to work or not?

@CodePirate7
Copy link
Author

CodePirate7 commented Feb 5, 2020 via email

@nasr18
Copy link

nasr18 commented Feb 6, 2020

then what plugin you are using to achieve this?

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

No branches or pull requests

3 participants