Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradfordmedeiros/mqtt_mongo
Logs all mqtt topics from a broker to a mongo database.
https://github.com/bradfordmedeiros/mqtt_mongo
database express http mongodb mqtt node
Last synced: about 2 months ago
JSON representation
Logs all mqtt topics from a broker to a mongo database.
- Host: GitHub
- URL: https://github.com/bradfordmedeiros/mqtt_mongo
- Owner: BradfordMedeiros
- Created: 2017-02-18T08:24:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T07:07:32.000Z (over 7 years ago)
- Last Synced: 2024-12-06T01:07:38.290Z (about 2 months ago)
- Topics: database, express, http, mongodb, mqtt, node
- Language: JavaScript
- Size: 20.5 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mqtt_mongo
### Description ###
Logs mqtt topics to a mongo database. All topics are logged to the collection topics.
Special collection called events produced which will log redundant topics that are prefixed with /event and logged to the collection events.This requires you to have a MQTT broker and MongoDB instance that you can connect to.
### Usage ###
~~~const mqtt_mongo = require('mqtt_mongo');
const config = {
MQTT_URL : 'http://127.0.0.1:1883',
MONGO_URL: 'mongodb://localhost:27017/databaseName'
}mqtt_mongo.logMqttToMongo(config);
~~~
An example of a record from the topic collection:
~~~~
{
"_id" : ObjectId("58e34271bd9277145fae0258"),
"topic" : "/any/topic/here",
"message" : "324234",
"timestamp" : ISODate("2017-04-04T06:51:29.832Z")
}
~~~~And a record the event collection:
~~~~
{
"_id" : ObjectId("58e3423a2ba24d13fb898214"),
"event" : "event/can/be/used/for/a/variety/of/special/purposes/or/not/at/all",
"timestamp" : ISODate("2017-04-04T06:51:29.832Z")
}
~~~~### Need Help? ###
Feel free to send me an message or raise an issue on github.