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
- Paused project can't activate
I have failed to reactivate one my projects which had been paused
- Site deployment keeps getting failed
Hi good folks, need a hand with Sites deploy Error on every deploy: Synchronous function execution timed out... duration doesn't exceed 30 seconds [exact log ...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...