question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filtering does not work on embedded fields

See original GitHub issue

If I try to filter query by field in embedding I receive 500 error. Request /farms?filter=customerStatus.feedAccountNumber||$eq||8999996

Error [Nest] 52408 - 03/15/2021, 12:44:12 PM [ExceptionsHandler] ER_BAD_FIELD_ERROR: Unknown column 'customerStatus.feedAccountNumber' in 'where clause' +114696ms QueryFailedError: ER_BAD_FIELD_ERROR: Unknown column 'customerStatus.feedAccountNumber' in 'where clause'

Farm Class

@Entity('farms')
export class Farm {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @Column(() => CustomerInfo)
  customerStatus: CustomerInfo;

  @CreateDateColumn()
  createdAt: Date;

  @UpdateDateColumn()
  updatedAt: Date;
}

CustomerInfo class

export class CustomerInfo {
  @Column({
    type: 'enum',
    enum: FeedCustomerStatus,
    default: FeedCustomerStatus.INACTIVE,
  })
  feedStatus?: FeedCustomerStatus;

  @Column({ nullable: true })
  feedAccountNumber?: string;

  @Column({
    type: 'enum',
    enum: PulletCustomerStatus,
    default: PulletCustomerStatus.INACTIVE,
  })
  pulletStatus: PulletCustomerStatus;

  @Column({ nullable: true })
  pulletAccountNumber?: string;

  @Column({ nullable: true })
  accountName?: string;
}

I tried join, alias, nothing helped

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

3reactions
applicature-mark-boychukcommented, Aug 17, 2021
CleanShot 2021-08-17 at 14 35 10@2x This is how I did it
1reaction
sofiamicrobiocommented, Dec 16, 2021

I have the same problem here, is there any other solutions? it seems ugly to use a BeforeInsert and duplicate fields 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filtering on nested objects does not work · Issue #3434 - GitHub
I just faced the same issue in the user interface. In the sidebar if you click Add filter then select a non relation...
Read more >
Filters don't work in Non-nested aggregation on nested fields ...
When running non-nested aggregation, the nested context is lost and the filters have no effect on the aggregation buckets.
Read more >
Solved: Filtering Power BI Embedded Report Not Working
Solved: Hello, I'm trying to filter an embedded report by "Sort field" and it doesn't seem to be working. The fields of the...
Read more >
Release and location fields will not appear in the embedded ...
In the embedded filter choose "keyword" and then type release: ... This will work with any normal field (unfortunately not with location.
Read more >
Filtering on nested fields - Kibana - Discuss the Elastic Stack
I have a nested field called 'metadata' in my index with various fields inside. For some reason filtering in Kibana does not work....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found