nestjs-typegoose
nestjs-typegoose copied to clipboard
How do I get the 'connection' object of 'mongoose'
I want to use some plugins in mongoose, but the plugins need a 'connection' object. How do I get it?
I was able to get the connection with:
import { getConnectionToken } from 'nestjs-typegoose';
@Injectable()
export class MyService {
constructor(
...
@Inject(getConnectionToken()) private connection: mongoose.Connection,
...
) {}
}
@q389491729 which plugin you are talking about? mongoose-auto-increment plugin?
yes. mongoose-auto-increment plugin
---Original--- From: "Mohamed Nasrullah"<[email protected]> Date: Wed, Feb 5, 2020 23:19 PM To: "kpfromer/nestjs-typegoose"<[email protected]>; Cc: "Mention"<[email protected]>;"CodePirate"<[email protected]>; Subject: Re: [kpfromer/nestjs-typegoose] How do I get the 'connection' object of 'mongoose' (#46)
@q389491729 which plugin you are talking about? mongoose-auto-increment plugin?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@q389491729 is that plugin working with nestjs?
yes,but I don't know how to do
---Original--- From: "Mohamed Nasrullah"<[email protected]> Date: Thu, Feb 6, 2020 00:54 AM To: "kpfromer/nestjs-typegoose"<[email protected]>; Cc: "Mention"<[email protected]>;"CodePirate"<[email protected]>; Subject: Re: [kpfromer/nestjs-typegoose] How do I get the 'connection' object of 'mongoose' (#46)
@q389491729 is that plugin working with nestjs?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Did you made it to work or not?
I tried to make it work, but it never worked.
---Original--- From: "Mohamed Nasrullah"<[email protected]> Date: Thu, Feb 6, 2020 03:30 AM To: "kpfromer/nestjs-typegoose"<[email protected]>; Cc: "Mention"<[email protected]>;"CodePirate"<[email protected]>; Subject: Re: [kpfromer/nestjs-typegoose] How do I get the 'connection' object of 'mongoose' (#46)
Did you made it to work or not?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
then what plugin you are using to achieve this?