What is MongoDB's Role-Based Access Control?
I am fairly new to MongoDB. I was going through the mongoDB documentation of its Role-Based Access Control feature.
I am a bit confused.
Is this the same as adding a roles array in a user schema(as in the example below)?
const mongoose = require('mongoose');
const UserSchema = new mongoose.Schema({
username: type: String,
email: type: String,
roles: ['admin'],
})
Or is it adding permissions to users who can access and manipulate the DB directly without the use of apis?