Skip to content

Querying & selecting nested relationship#10552

Description

@Amrhub

馃憻 Reproduction steps

Tables:

  1. inspection
  2. customer
  3. car

Relationships:
customer -> car (one to many).
customer -> inspection (one to many).
car -> inspection (one to many).

Query:

Query.contains('plate_number', plateNumber),
      Query.equal('tenant_id', getUserActiveTenantId()),
      Query.select([
        '*',
        'inspections.$id',
        'inspections.type',
        'customer.*',
        'customer.inspections.type',
      ])

if query returns more than one car it will only attach customer.inspections to the first car the rest will only get customer only without the customer.inspections.

馃憤 Expected behavior

Every element in the car to obey to the query.select

馃憥 Actual Behavior

When multiple cars appeared on search:

Image Selecting `BAIC U5 PLUS` Image

When a single car appeared on search:

Image

Selecting the same vehicle BAIC U5 PLUS

Image

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

MacOS

馃П Your Environment

"appwrite": "^19.0.0",

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

Labels

feature / relationshipsFixes and upgrades for database relationshipsproduct / databasesFixes and upgrades for the Appwrite Database.questionFurther information is requested

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions