2022-02-14 07:45:34 +00:00
|
|
|
from pymongo import MongoClient
|
|
|
|
from bson.objectid import ObjectId
|
|
|
|
from time import sleep
|
|
|
|
|
2022-02-14 09:59:21 +00:00
|
|
|
MONGO_URI="mongodb://127.0.0.1:27017/default"
|
2022-02-14 07:45:34 +00:00
|
|
|
|
2022-02-14 09:59:21 +00:00
|
|
|
db = MongoClient(MONGO_URI).get_default_database()
|
2022-02-14 07:45:34 +00:00
|
|
|
|
|
|
|
while True:
|
2022-02-14 09:59:21 +00:00
|
|
|
db.eventlog.insert_one({ "timestamp": "...", "event": "motion-detected", "started": "...", "finished": "...", "component": "motion-detect", "camera": "Server room", "action": "event",
|
|
|
|
})
|
2022-02-14 07:45:34 +00:00
|
|
|
sleep(1)
|