Category "nestjs"

Postgres OVERLAPS date function in TypeORM

I want to transfer the query to TypeORM. It looks like this in Postgres SELECT * from equipment_charging where (equipment_charging."start_date"::date, equipme

How can I unit test that a guard is applied on a controller in NestJS?

I've got a controller configured in NestJS and I want to check that the appropriate guards are set - does anyone have an example of how it could be done? This

Nestjs Mongodb always return empty array

I am trying to create a simple nestjs project that connects to mongodb. I followed the official documentation of nestjs, but connected to my own db with "user"

How to enable NestJs swagger 4.x plugin

How do you use the new swagger plugin? I have it in my compiler options: "compilerOptions": { "plugins": ["@nestjs/swagger/plugin"] } And I am runni

How to apply Global Pipes during e2e tests

How do you apply global pipes when using Test.createTestingModule? Normally, global pipes are added when the application is mounted in main.ts. beforeEach(asy

NestJS and Serverless - handler 'handler' is not a function

I am trying to implement NestJS as a AWS Serverless function using serverless-framework. I was following this official documentation and my code is exactly as i

NestJS: How to retry when Kafka consumer fails?

There might be a situation where even though the message is received from Kafka, but due to some reason (Database is down, webhook is offline or ...) still the

Is there anyway to get types interfaces for request, response in Nest.js with Fastify

I am learing Nest.js and on the beging of documentation I read that I can use it not only with express but also with fastify so I setuped up my first project wi

TypeORM problem saving entity with cascade true

I m using NestJS with TypeORM and I m trying to save a user conversation with messages. I set the messages field on the conversation entity to cascade: true. Bu

NestJS Share e2e server between test suites

I'm using NestJS test module to mock the nest app and I want to share this app among various test suites. Here's my setup: test |_ helpers |_ testApp.ts

Injected nestjs service in to CQRS is undefined

I have a service to import in CQRS but in runTime, I got an error for the service method the service declared in constroctor and using it in excute methode @Com

Cannot read property 'byteLength' of undefined for aws-sdk js v3 for dynamodb client

I'm trying to connect a nestjs backend (node) with a dynamodb table using @aws-sdk/client-dynamodb but I have a server error: [Nest] 24019 - 24/08/2021, 21:19:

Connect to a Nest.js server inside a docker container

I'm trying to create a container for a Nest.js server. For now,I only have the basic version of the server that creates automatically when you create a Nest pro

How to import directives in a nestJS graphQLModule?

I need to generate typeScript types for mongoDB using graphql-code-generator and the typescript-mongodb plugin, but I don't understand how to import the directi

How to catch 3rd party api error response using NestJS' httpService?

Suppose i make a request using httpService like this const response = await this.httpService .request({ url: 'https://example.com/data', m

Trying to persist not discovered entity of type object

The problem I'm new to Nest.js and Mikro-ORM, which I have to learn as a job requirement. This stack requires TypeScript, which I despise from the bottom of my

Updating Multiple Records with varying conditions in a single query

With Typeorm + NestJS + Postgres is there a way to update multiple records with varying conditions and varying values in a single query. Normally I could do awa

nestjs return undefined in Public Guards

I follow this link https://docs.nestjs.com/security/authentication#enable-authentication-globally I went ahead and create a public guard But it does not recogni

How can i get domain name in Nestjs?

Now, i want to get domain name. I don't want hardcode for path return eg: https://mydomain/url-img. My purpose is when i develop in local enviroment, I can ret

How to upload Files and Other fields with Request Body in Nestjs

I want to upload three fields like: Example Data: partner_id: 3638, review: [{'product_id': 155, 'order_sku_id': 155, 'review_title': 'Orange Review','rating':