MongoDB with DBine

How to connect DBine to MongoDB and what you can do once it's connected. This page is written from what the MongoDB driver says about itself, so it matches the version of DBine you download.

Connect

  1. In DBine, open New connection.
  2. Pick MongoDB in the list of engines.
  3. Fill in the fields below, press Test connection and then Save.

Default port: 27017.

General

FieldDescription
ServerSeveral members separated by commas: host1:27017,host2:27017.
Example: localhost
Port
DatabaseInitial database; empty = the one in the connection string or “test”.
AuthenticationKerberos uses the session's ticket (on macOS and Linux, the one from kinit user@REALM) and requires MongoDB Enterprise.
Options: Username and password, Kerberos (GSSAPI)
Default: Username and password
UserWith Kerberos, the principal (user@REALM).
PasswordKept in the system keychain, never in DBine's files.
Only with Authentication: Username and password.
Connection stringIf filled in, it replaces the other fields. It also works for Azure Cosmos DB (MongoDB API) and MongoDB Atlas.
Example: mongodb+srv://user:password@cluster.example.net/db
Kept in the system keychain, never in DBine's files.
Read-onlyOn or off.

SSH tunnel. The connection can go through an SSH server, even through a chain of bastions, with a password, a private key or the SSH agent. The server's fingerprint is checked against known_hosts or confirmed the first time.

SSL/TLS

FieldDescription
Encrypt the connection (TLS)On or off.
Trust the server certificateOn or off.

Advanced

FieldDescription
Authentication databaseExample: admin
Only with Authentication: Username and password.
Kerberos serviceThe name of the service the server is registered under; almost always «mongodb».
Example: mongodb
Only with Authentication: Kerberos (GSSAPI).
Replica setReplica set name; empty = direct connection to the server.

What the explorer shows

Under the connection: Databases. Inside each one:

Query editor

The editor uses MongoDB's own query syntax, in JSON, with completion for the connection's objects. Statements and commands run against the database selected in the tab.

What the editor accepts:

mongosh-like syntax, one statement per line or separated with `;`:
db.collection.find({ age: { $gt: 30 } }, { name: 1 }).sort({ age: -1 }).limit(10)
db.collection.aggregate([{ $group: { _id: "$city", n: { $sum: 1 } } }])
db.collection.countDocuments({}) · db.collection.distinct("field", {})
db.collection.insertOne({…}) · updateMany(filter, { $set: {…} }) · deleteOne(filter)
db.getCollectionNames() · db.runCommand({ dbStats: 1 })
db.createCollection("c", { capped: true, size: 4096 }) · db.createView("v", "c", [{ $match: {} }])
db.getCollection("c").createIndex({ field: 1, date: -1 }, { unique: true }) · dropIndex("field_1") · db.dropDatabase()
DBine extension: db.createCollection("c", {…}, { ifNotExists: true }) does not fail if the collection already exists.
A raw JSON command is also accepted: { "find": "collection", "filter": {} }.
Unquoted keys, single quotes, ObjectId("…"), ISODate("…"), NumberLong(…) and /regex/i.

Ready-made templates for new objects:

Tools for MongoDB

Available

  • Graphical execution plans
  • Live query profiler
  • Server monitor
  • Sessions and running queries
  • End a session
  • Locks: who blocks whom
  • Cancel another session's query from the sessions list
  • Index usage
  • Create databases
  • Drop databases
  • Database properties
  • Visual designer for new objects
  • Rename objects
  • Compare and sync schemas
  • Native bulk load when migrating data
  • Users and permissions

Not available for MongoDB

  • Manual transactions (commit and rollback)
  • Relations in the ER diagram
  • Clone tables
  • Backups

Why a tool doesn't apply to an engine, and the details of each one, are in the engine support reference.

Generated from the MongoDB driver 0.1.12, which DBine downloads the first time you connect to MongoDB.

Download DBineAll engines