typeorm / typeorm

ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
http://typeorm.io
MIT License
34k stars 6.27k forks source link

findDescendants function not working properly #7637

Open imkks opened 3 years ago

imkks commented 3 years ago

Issue Description

When I call findDescendants function on 'materialized-path' tree, it returns all elements in the table. I tried to call createDescendantsQueryBuilder as well, but the same issue.

Expected Behavior

Actual Behavior

// async findDescendants(name: string): Promise<Hierarchy[]> {
   // const parent = await this.treeRepository.findOne({ where: { name } });
    //   return await getConnection().getTreeRepository(Hierarchy).findDescendants(parent);
//}

Steps to Reproduce

1. 2.

// insert code here

My Environment

Dependency Version
Operating System
Node.js version vX.Y.ZZZ
Typescript version vX.Y.ZZZ
TypeORM version vX.Y.ZZZ

Additional Context

Relevant Database Driver(s)

Are you willing to resolve this issue by submitting a Pull Request?

rluvaton commented 2 years ago

How do you insert data to the DB?