Skip to content
Back

Query without relationships

  • 0
  • Databases
  • Cloud
mariojuanaaa
27 Mar, 2025, 14:29

Is there a way to query a collection so that it doesn't return all the connected relationships?

For example, if the user has vehicles as a 1 or a 2 way relationship, it does return the vehicles results when querying for the user. I have a ton of vehicles per user and a lot of queries I'm using doesn't need any vehicle data, so i don't want it to count towards my rows read

Is there a way to not return the vehicles?

Bonus: if there is a way, would it count towards the rows read for vehicles as well?

TL;DR
Developers are seeking ways to query a collection without retrieving connected relationships, specifically discussing the scenario where users have relationships with vehicles. They aim to exclude vehicle data in their queries to avoid unnecessary rows read. One potential solution is to use projection queries to exclude specific fields like vehicles from the query results. Additionally, utilizing this method may not count towards the rows read for vehicles, ultimately optimizing query performance.
D5
27 Mar, 2025, 14:33

Don't use relationships

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