Connecting to a DB
Last updated
Was this helpful?
Last updated
Was this helpful?
This endpoint will connect to a Mongo DB database. It will then query all documents from the "venues" collection and return them to the user.
To set it up:
Drag and drop a mongodb node and click on it to open the settings.
If that's the first time you are viewing the settings of a mongodb node for this Diagram project, you will be asked for the mongodb connection URI. That authorises Diagram to access your MongoDB database. Set the query type to "Find" and "many" and the collection name to "venues" (or the name of your own collection).
Connect the request node from the "Params" port to the mongodb node on the "Options" port. As the mongodb node will query the whole collection we don't need any parameters. So it doesn't matter if we connect from the "Headers" port or the "Params" port and if we connect to "Filter" or "Options".
In a similar manner, connect the mongodb node from the "Out" port to the "Source" port of the response node.
If you haven't already check out the endpoint.
Similarly, to the endpoint we can call this endpoint in the debug panel or by using the endpoint url in a frontend or in another nocode app.