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

Can't configure dbname or collection of database in nest-pulse config. #7

Open
cemusta opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@cemusta
Copy link
Contributor

cemusta commented Nov 22, 2024

Hi,

Can't set values of db name and collection name when creating a pulse module config.

  • There is no dbname property for setting the database name.
  • There is a collection property but it's not changing the default "job" collection.
export const pulseOptions: PulseModuleAsyncConfig<PulseModuleConfig> = {
  imports: [ConfigModule],
  useFactory: async (configService: ConfigService) => {
    const config: PulseModuleConfig = {
      db: {
        address: configService.getOrThrow<string>('JOB_DB_CONNECTION'),
        // dbname: mydbname, // this option is missing.
        collection: 'mycollection', // this option is not working.
        options: {
          appName: 'job-engine',
          retryWrites: true,
          writeConcern: {
            w: 'majority',
          },
        },
      },
    };
    return config;
  },
  inject: [ConfigService],
};
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

1 participant