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
TL;DR
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.Recommended threads
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...
- I have try to use the appwrite in to the...
Invalid Origin. Register your new client (oailedjdbkhlkakmnnapoonllbnfmfij) as a new Web (Chrome Extension) platform on your project console dashboard
- Paused project can't activate
I have failed to reactivate one my projects which had been paused