Hi @Jimmy Tsang,
We are unable to filter items in caml query when the items over 5000. What we can do is to fetch all the items by camlQuery.ViewXml = "<View Scope='RecursiveAll'><RowLimit>5000</RowLimit></View>";
and filter the data in local by if condition.
Here is a similar issue with yours, please make a reference
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.