I am using appwrite node sdk to get list of all users, users.list()
, however I am getting sensitive informations like password hashes in response. Is there any way to omit those fields while making the query ?
What exactly are you trying to do? What's your use case?
After catching the response, exclude those sensitive key: value pairs and create brand new object yourself and send that modified object as response brother.
I am trying to get the user details using list of user ids. I don't want sensitive fields like password.
Hmm I did that but I want something more efficient. Like filtering directly while making the query just like we have option to omit fields in mongodb using .select() . Filtering after getting the response might be a bit inefficient if there are large number of users
Yes, this is using MariaDB, Reddis
I think, there won't be this feature. may be they will introduce it in their next version if we could post issue in their repository. with valid argument.
I understand that part, but why? Can you provide more context on your use case?
Basically, I have a collection called "reviews" that has a field called user_id which maps to the unique id of user. When I fetch reviews, I want the full name and email of user. Currently, I am fetching user details and reviews separately on client side and then populating each reviews with name and email of user who posted it.
I know it can be done securely using server sdk, but I was wondering if there are ways to omit certain fields while making queries.
You really want to expose people's emails? 🧐
The way I typically handle this is to create a profiles collection for the public facing attributes
Hye @yaman Just asking
Are you making any admin dashboard for which you need to list users?
Just add a new field for username in the reviews and add the name of the user to the field while they create the review instead of fetching users and reviews separately. Just a suggestion 😊
There's a Query.select
query that you can use for this, but I'm not sure if this was a feature added in 1.3.x
.
not exactly
Recommended threads
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...