Integration
MongoDB
NoSQL document database
- Category
- Databases
- Runs in
- The Phloem cloud — nothing to install
Lets you and Hamming read documents from a MongoDB database, with each collection's fields listed in Trace.
What Phloem reads
- The database's collections, with field names and types taken from the first 100 documents of each, listed in Trace
- Collections named
system.*are left out
Phloem only reads. It never writes to MongoDB.
What you need
- The server's host, port (default 27017) and database, or a full connection string such as
mongodb+srv://… - A user that can read the database, unless the server has no authentication
- Network access from Phloem's cloud to the server
Connect
- In the console, open Connectors, choose Add connector, then MongoDB.
- Enter a Display Name.
- Under Authentication Method, choose:
- Username & Password — Host, Port, Database, Username and Password. Auth Source is the authentication database (default
admin). Set Replica Set if you connect to one. - Connection String — paste the full URI.
- Username & Password — Host, Port, Database, Username and Password. Auth Source is the authentication database (default
- Choose Test Connection (it shows the server version), then Create Connection.
What Hamming can do
- Run find queries with JSON that you or Hamming write:
{"collection": "users", "filter": {"age": {"$gt": 25}}, "limit": 100}, with an optionalprojection
Notes
- A query returns 100 documents unless it sets
limit. - Aggregation pipelines are not supported. Queries are
findwith a filter.
#Connection fields
What the Add connector form asks for.
| Field | Type | Required |
|---|---|---|
Hostlocalhost | Text | — |
Port27017 | Number | — |
Databasemydb | Text | — |
| Username | Text | — |
| Password | Secret | — |
| Auth Source Authentication database admin | Text | — |
| Replica Set Replica set name (optional) | Text | — |
| Connection String Full MongoDB connection URI mongodb+srv://user:pass@cluster.mongodb.net/db | Text | — |
Updated