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.
Asked
Active
Viewed 2,267 times
-1
-
No code = off-topic for `arduino` tag. – TomServo Feb 20 '21 at 02:32
-
@TomServoThanks, I'll take care next time. – Prashant Mishra Mar 01 '21 at 06:18
2 Answers
1
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.

D. SM
- 13,584
- 3
- 12
- 21
0
There is no Arduino driver for MongoDB. This leaves you with these choices:
- implement it yourself
- adapt their C or C++ drivers
- use the NodeMCU firmware for ESP8266 and see if the Lua driver for MongoDB works on top of it
- use MicroPython on the ESP8266 and see if MongoDB's Python driver works on top of it

Marcel Stör
- 22,695
- 19
- 92
- 198
-
For now then, I am implementing it using API then, later I'll try to using Micro Python. Thanks :-) – Prashant Mishra Mar 01 '21 at 06:22