Problem Statement:
I need to restrict access to PII data in a collection based on user roles. Specifically, I have two types of users:
Admin – Can view all data, including PII fields.
Restricted User – Should not be able to see PII fields.
Questions:
How can I configure access so that certain users cannot see PII fields?
Is it possible to enforce this via a connection string?
What are the best practices for implementing this in a MongoDB/PostgreSQL/MySQL setup?