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
- Problem with the new Email policies
when user set those thing from cloud panel and when they open that page again or reload that time it forget what we have checked and it set default to false on ...
- Deleted my account, trying to signup aga...
https://cloud.appwrite.io/console/login?error=%7B%22message%22%3A%22This+email+address+must+already+be+in+its+canonical+form.+Please+remove+aliases%2C+tags%2C+o...
- Unable to create Sites or Functions with...
Heya, I was looking at the appwrite documentation for Sites API with the server api: https://appwrite.io/docs/references/cloud/server-nodejs/sites I can’t fin...