Back

Query.or with Query.equal('$id', id) dont work (Invalid query: Attribute not found in schema: _uid)

  • 0
  • Self Hosted
  • Databases
_alnes_
9 May, 2024, 08:43

Selfhosted: Version 1.5.5 Sdk: "appwrite": "^14.0.1"

TypeScript
[
        Query.or([
          Query.equal('$id', parentDocumentId),  
          Query.equal('parentDocumentId', parentDocumentId)
        ])
      ]

I get this error: Invalid query: Attribute not found in schema: _uid

Outside of Query.or it works. Should it be like that?

Thanks πŸ™‚ Matze

TL;DR
Issue: Query.or with Query.equal('$id', id) causing error "Invalid query: Attribute not found in schema: _uid." Possible Solution: The error is likely due to the incorrect use of `$id` in the Query.equal function. To fix this, use `$uid` instead: ```ts [ Query.or([ Query.equal('$uid', parentDocumentId), Query.equal('parentDocumentId', parentDocumentId) ]) ] ``` Remember to adjust the attribute name to align with your schema.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more