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
- Realtime api and labels as permission
in my tables i set labels as permission and real-time capabilities stopped working. Before when i was having "any" role everything was working. Note: user have...
- Sveltekit + Bun sites runtime not deploy...
anyone tried deploying sveltekit + bun sites? its building but not running, and the only thing from build console to value is ``` > Using svelte-adapter-bun .s...
- Domain is owned by a different organizat...
I was trying to add a domain to one of my projects however, it keeps giving me the error of Domain is owned by a different organization. I did have a self hoste...