Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/user-search-filter-negate-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/backend': patch
---

Correct the `UserSearchMetadataFilter` JSDoc. A negated `equals` filter matches users that hold the key with a different value, not every user the filter does not match, and `equals` matches any item when the key holds an array.
4 changes: 2 additions & 2 deletions packages/backend/src/api/endpoints/UserApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export type UserSearchMetadataFilter = {
scope: 'public' | 'private' | 'unsafe';
/** A dot-separated path into the metadata, for example `settings.theme`. Escape a literal dot in a key as `\.`. */
key: string;
/** `exists` matches users that hold the key, whether it holds a value or nested keys. `equals` matches the whole value, case-insensitively. */
/** `exists` matches users that hold the key, whether it holds a value or nested keys. `equals` matches the whole value, case-insensitively. If the key holds an array, `equals` matches any item in it. */
match: 'exists' | 'equals';
/** The value to compare against. Required for `equals` and not allowed for `exists`. */
value?: string;
/** If `true`, returns the users the filter does not match instead. */
/** If `true`, `exists` matches users that do not hold the key, and `equals` matches users that hold the key with a different value. */
negate?: boolean;
};

Expand Down
Loading