deep-printerverseOriginal post
Rank 1: Thread
Hello, I was trying to use teams.listMemberships method in JavaScript SDK and I wanted to search by userName attribute. I tried two ways to search on the name:
- The
searchparameter in thelistMembershipsmethod. This parameter looks like it only searches on the ID and not user name. Query.search("userName", search)gives an errorappwrite.js?v=76cc79fe:850 Uncaught (in promise) AppwriteException: Invalidqueriesparam: Invalid query: Attribute not found in schema: userName.
How can I search on userName then? What is the attribute for teams which holds the userName? Thank you
Summary
To search by `userName` when listing team memberships using the Appwrite JavaScript SDK:
- The `teams.listMemberships` method does not support searching by `userName`.
- Use the `teams.listMemberships` method to retrieve a list and then filter locally by `userName`.
- The `Query` class method does not work for searching by `userName`.
- The attribute for teams holding `userName` may not be directly searchable in this context.