We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello there,
Account has many LedgerRecords LedgerRecord has one Account
Prerequisites
@Entity({ tableName: 'accounts' }) export class Accounts { @PrimaryKey() id!: number; @OneToMany({ entity: () => LedgerRecords, mappedBy: lr => lr.account }) ledgerRecords = new Collection<LedgerRecords>(this); }
@Entity({ tableName: 'ledger_records' }) export class LedgerRecords { @PrimaryKey() id!: number; @ManyToOne({ entity: () => Accounts, inversedBy: acc => acc.ledgerRecords, cascade: [Cascade.MERGE], fieldName: 'account_id', }) account!: Accounts; }
I did this type of call:
accountsRepo.findOne({ ledgerRecords: { id: 18, } });
select "e0".* from "accounts" as "e0" where "undefined"."id" = 18 limit 1
select "e0".* from "accounts" as "e0" left join "ledger_records" as "e1" on "e0"."id" = "e1"."account_id" where "e1"."id" = 18 limit 1
node -v v12.18.0
@mikro-orm/core @ 4.0.5 @mikro-orm/nestjs @ 4.0.0 @mikro-orm/postgresql @ 4.0.5 typescript @ 3.9.7
accountsRepo.findOne({ ledgerRecords: { $and: [ { id: { $eq: 18 } }, { id: { $ne: null } } ] } })
Thank you for the great library, have a good day!
The text was updated successfully, but these errors were encountered:
920995f
@B4nan thanks, you're awesome!
Sorry, something went wrong.
B4nan
No branches or pull requests
Hello there,
Account has many LedgerRecords
LedgerRecord has one Account
Prerequisites
I did this type of call:
Actual behavior:
Expected behavior
Additional details
Environment
Workaround
Thank you for the great library, have a good day!
The text was updated successfully, but these errors were encountered: