
When trying to load a nested relationship using the below query I get this error: Invalid query: Attribute not found in schema: *
TypeScript
try {
final queries = <String>[
Query.select(['*', 'accounts.*, accounts.owner_id.*']),
Query.orderDesc('\$createdAt'),
Query.limit(limit),
];
if (cursor != null && cursor.isNotEmpty) {
queries.add(Query.cursorAfter(cursor));
}
final response = await tableDBSignal.value!.listRows(
databaseId: Constants.dbID,
tableId: Constants.transactionsDB,
queries: queries,
);
return response.rows.map((doc) => Transactions.fromMap(doc.data)).toList();
} on AppwriteException catch (e) {
log('Error fetching transactions: ${e.message}, ${e.code}');
return [];
}
TL;DR
Issue: Error message "Invalid query: Attribute not found in schema" when attempting to load nested relationships in a query.
Solution: Ensure that the attributes referenced in the nested relationship query are correctly specified in the schema. Double-check that the attributes like 'accounts' and 'owner_id' are properly defined in the schema to avoid this error.Recommended threads
- CSV import not working
When i upload csv file for user access then it successfully unloaded but not actually data.
- Error in Migration to Cloud for Database...
We were using Appwrite self-hosted (old version, 1.5.10) for some time but made the switch to Cloud now and want to migrate our data over. Since the version ju...
- Missing required parameter: "siteId
I've been trying to delete a website build but can't because it keep mentioning ( Missing required parameter: "siteId"), any advice on how to fix it please?
