-1

Is it possible to give access to a user to only one document in a collection which is in my Mongo Data Base ?

I saw that this is possible for one collection.

1
  • 1
    What access permissions do you want to grant and what is your use case for single document access? Is this for a limited set of users or will you have many? What version of MongoDB server are you using? You can create a read-only view in MongoDB 3.4 or newer, but single document access might be better suited to an API depending on your use case.
    – Stennie
    Apr 27, 2018 at 21:50

1 Answer 1

0

As MongoDB documentation here MongoDB employs Role-Based Access Control (RBAC) to govern access to a MongoDB system. A user is granted one or more roles that determine the user’s access to database resources and operations. Outside of role assignments, the user has no access to the system.

MongoDB does not enable access control by default. You can enable authorization using the --auth or the security.authorization setting. Enabling internal authentication also enables client authorization.

Once access control is enabled, users must authenticate themselves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.