Hello, I'm creating a query: @Query() query: AnalyticsRequestDTO<G> for my GET endpoint that consist of a DTO that looks like this:
export class AnalyticsRequestDTO<
G extends GroupableKeys,
P extends PopulateableKeys<G> | undefined = undefined
>
implements AggregateRunLogAnalyticsOptions<G, P>
{
@IsObject()
@IsOptional()
@ApiProperty({
description: 'Filters to apply to run logs before aggregating',
required: false,
})
filter: AnalyticsFilterDTO = {}
@IsArray()
@ApiProperty({
description: 'The fields to group by',
required: false,
})
groupBy: G[]
@IsArray()
@IsOptional()
@ApiProperty({
description: [
'Populate certain fields by joining with other collections.',
'',
'Values in this list must be a subset of `groupBy`, and can only',
'apply to id fields. Instead of containing',
'an ObjectId, populated fields will contain the document the id',
'refers to.',
].join('\n'),
type: [String],
required: false,
})
populate?: P[]
}
The problem here is that the AnalyticsFilterDTO is getting spread, like you can see in the attached image. I want to know how to prevent this from happening, as the normal behavior is to send the query wrapped in the filter object (i.e. { filter: { ruleId: '...', appId: '..', ... }).