Bug: Unable to filter listMembers
Issue:
When using organization plugins, I encountered an issue with filtering members by role using the
filterOperator: "contains"
.
I have a member with multiple roles (e.g., owner,member
). When I apply a filter to the listMembers
function to retrieve members with a specific role (e.g., member
) using the contains
operator, the function does not behave as expected.
const data = await auth.api.listMembers({
query: {
organizationId: "organization-id",
filterField: "role",
filterOperator: "contains",
filterValue: "member",
},
});
Setup:
- "better-auth": "^1.3.11",
- "next": "15.5.3",
- "drizzle-orm": "^0.44.5",2 Replies
What's your DB?
hi @Max thanks for reply. I'm using Neon
Also I connect it via Htpp like this
"import { neon } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';
const sql = neon(process.env.DATABASE_URL!);
const db = drizzle({ client: sql });
"