I try to filter a row which contain a string inside a string array column, however I get the following error:
{"name":"AppwriteException","code":400,"type":"general_query_invalid","response":"{\"message\":\"Invalid query method: contains\",\"code\":400,\"type\":\"general_query_invalid\",\"version\":\"1.8.0\"}"}
Is Query.contains() not supported on Cloud?
This is the code snippet:
const queries = [
Query.or([
Query.contains('visibility', 'public'), // Include posts with public visibility
Query.contains('visibility', currentUserId), // Include posts visible to the current user
]),
];
try {
return await ctx.backendClient.tablesDb.getRow<IPostsRow>({
databaseId: CDBApp,
queries,
rowId: postId,
tableId: ETable.Posts,
});
} catch (e) {
ctx.error(JSON.stringify(e));
throw new IKNotFoundError();
}
The intent: Even if the post exists, it should only be returned if the user is allowed to see it according to the visibility
Recommended threads
- Rate limit
How do I solve "Signup Failed, Rate limit for the current endpoint has been exceeded. Please try again after some time"? I have Pro and around 2k requests per ...
- Type 'Theme' does not satisfy the constr...
Type 'Theme' does not satisfy the constraint 'Row'. Type 'Theme' is missing the following properties from type 'Row': $id, $sequence, $tableId, $databaseId, a...
- Dev Keys not working
looks like dev key are broken they simply don't work i suggest remove them until you have them working otherwise they confuse devs took me few minutes trying ...