logo

MongoDB

Use the mongo command line to execute one-off commands and open interactive sessions.

Features

The table below explain which features are available for this kind of connection.
  • Native - it's when a database client is connecting via protocol (.e.g: IDE, client libraries)
  • One Off - it's when a hoop client performs ad hoc executions (e.g: webapp, hoop cli)
Feature
Native
One Off
Description
TLS Termination Proxy
🚫
The local proxy terminates the connection with TLS, enabling the connection with the remote server to be TLS encrypted.
Audit
🚫
The gateway store and audit the queries being issued by the client
Data Masking (DLP)
🚫
A policy can be enabled to mask sensitive fields dynamically when performing queries in the database.
Credentials Offload
🚫
The user authenticates via SSO instead of using database credentials.
Interactive Access
🚫
Interactive access is available when using an IDE or connecting via a terminal to perform analysis exploration.

Configuration

Name
Type
Description
HOST
env-var
The IP or Host of the Mongo DB server
PORT
env-var
The port of the Mongo server
USER
env-var
The user to connect in the Mongo server
PASS
env-var
The password to connect in the Mongo server
shell
hoop admin create conn mongo -a <agent> \ -e HOST=<host> \ -e PORT=<port> \ -e USER=<user> \ -e PASS=<pass> \ -- mongo --quiet 'mongodb://$USER:$PASS@$HOST:$PORT/'

How to Use

Start an interactive session with mongosh client
shell
hoop connect mongo
In the same connection, one-off process can be run as well
shell
hoop exec mongo <<EOF db.movies.insertOne( { title: "The Favourite", genres: [ "Drama", "History" ], runtime: 121, rated: "R", year: 2018, directors: [ "Yorgos Lanthimos" ], cast: [ "Olivia Colman", "Emma Stone", "Rachel Weisz" ], type: "movie" } ) EOF hoop exec mongo -- --eval 'db.movies.find()' hoop exec mongo -i 'db.movies.find()'

Powered by Notaku