![]() Python (46) AWS (45) Docker (36) Linux (28) Elasticsearch (24) DevOps (22) Storage (19) Kubernetes (19) Security (13) MongoDB (12) Python Flask (12) Monitoring (12) BigData (11) CICD (11) DynamoDB (10) NoSQL (9) Databases (9) Networking (9) Traefik (9) IAM (8) Swarm (8) RaspberryPi (8) Golang (8) Civo (8) S3 (7) Ubuntu (7) Lambda (7) NFS (7) Virtualization (6) VPN (6) Clustering (6) MySQL (6) Nginx (6) Analytics (6) GlusterFS (6) Java (6) API (6) Concourse (6) Programming (6) Pipelines (6) Prometheus (6) K3S (6) Authentication (5) Kibana (5) Deployment (5) Distributed Storage (5) Scripting (5) Flask-Series (5) Encryption (5) Ruby (4) Logstash (4) Hadoop (4) High-Availability (4) SSH (4) Bash (4) CLI (4) Filebeat (4) Performance (4) Alpine (4) Serverless (4) OpenFaas (4) Nagios (4) Jenkins (4) ELK (3) Mail (3) Ansible (3) LoadBalancer (3) Nodejs (3) MicroServices (3) Cryptography (3) Gitlab (3) Gitea (3) Drone (3) Letsencrypt (3) Containers (3) Grafana (3) ECS (3) Rails (2) Active Directory (2) DNS (2) Spark (2) Hive (2) PHP (2) EMR (2) Boto (2) Payara (2) WebApps (2) Reverse-Proxy (2) Minio (2) RocketChat (2) HAProxy (2) Search-Engine (2) API-Gateway (2) Terraform (2) EC2 (2) SSM (2) 12Factor (2) Ansible-Tutorial (2) Mac (2) Hello-World (2) Ruby-Tutorial-Series (2) Memcached (2) Caching (2) golang-tutorial (2) Multiprocessing (2) SSL (2) Metrics (2) Longhorn (2) Multipass (2) Getting Started (1) JavaScript (1) Piranha (1) asp. Share: Twitter Facebook LinkedIn Comments Thanks for reading, if you enjoy my content feel free to follow me on Twitter at subscribe to my newsletter. ![]() Actions are all those kinds of operations we can run against the database such as find, delete, insert, update, or createIndex. writeConcern indicates the authorization level. user is a mandatory document and contains the authentication of the new user, along with all other necessary information. These roles are defined in terms of actions on resources. The syntax of the MongoDB Create User command is as follows: Two other pieces of information are stored in this command in addition to the actual createUser command. List the collections and read the data from it for demonstration purposes: > use mytest MongoDB offers built-in roles and also enables you to define new ones depending on the specific requirements for the database. In this case read only access to the mytest db.įirst logon to mongodb and switch to the admin database: $ mongo -u dbadmin -p -authenticationDatabase admin The first method we will create the user and assign it the read permissions that he needs. Note: If you require a mongodb docker compose configuration, have a look at my docs page:įirst Method: Creating and Assigning the User One user that will have access to one MongoDB Database and all the Collections, and one user with access to one MongoDB Database and only one Collection. In this post I will demonstrate how to setup 2 read only users in MongoDB. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |