-
Notifications
You must be signed in to change notification settings - Fork 1
Database structure
Denis Koljada edited this page Aug 24, 2021
·
1 revision
The database consists of two data types in their respective mongodb collections and databases:
- The weather sensor data, stored in the database "syncmesh" inside the collection "sensor_data"
- The syncmesh node metadata, stored in the database "syncmesh_meta" inside the collection "nodes"
A weather sensor entry looks like this:
{
"sensor_id":2266,
"location":1140,
"lat":42.738,
"lon":23.272,
"timestamp":{"$date":"2017-06-30T22:00:07.000Z"},
"pressure":95270.27,
"temperature":23.466,
"humidity":62.48
}
Each respective entry has the following relevant fields, with the datatype written in parentheses:
- sensor_id is the unique sensor id (number)
- location is a unique location id, not used for our project (number)
- lat and lon are the latitude and longitude in degrees (number)
- timestamp is a timestamp when the measurement was registered (timestamp)
- pressure is the atmospheric pressure in pascal (number)
- temperature is the air temperature in degrees celsius (number)
- humidity is the concentration of water vapour in % (number)
For the node meta data, an entry looks like this:
{
"address": "http://some.ip.here",
"lat":42.738,
"lon":23.272,
"distance":0.5,
"own_node":false
"subscribed":true
}
Once again, here are the respective parameters with a short explanation and their data type:
- address is the IP of the specific node (string)
- lat and lon are the latitude and longitude in degrees (number)
- distance is the distance in kilometers to the own node (number)
- own_node specifies whether this database entry is the own node (boolean)
- subscribed specifies whether the own node is subscribed to this node (boolean)