How can I Send data directly over to MongoDB without any intermediary?

2.7k Views Asked by At

I wanted to update/push data directly over to the MongoDB using an ESP8266 Wi-Fi module in Arduino. I have seen some solutions referring to use MQTT / their own Node-Red Server to connect with MongoDB and then send connect the data. But I want to do it directly.

2

There are 2 best solutions below

1
On

There is no Arduino driver for MongoDB. This leaves you with these choices:

0
On

You do not need a "node-red server" to talk to a MongoDB server.

You either need to use a driver (which implements the wire protocol), or if you don't want to use the driver you can implement the wire protocol yourself and speak it directly. If you choose the latter route you can perform some optimizations that drivers don't do, like using a single connection. All of the required information for this is published in https://github.com/mongodb/specifications, though knowing WHAT to do when is non-trivial if you have no MongoDB experience.