Hey, I’m using MongoDB with KMongo to handle persi...
# ktor
t
Hey, I’m using MongoDB with KMongo to handle persistent data and I was wondering how to remove elements from being sent back in a response. Let’s say I have this model
Copy code
Profile { a: String, b: String }
When I access the route
/test
if I’m authenticated I want it to return a & b but if I’m not authenticated I want it to only return a I’m just not sure how to remove properties before they’re sent without having to make a “proxy” model to remove them.
b
t
Projection with exclude seems like what I need, thanks so much!
👍 1