29 lines
667 B
Lua
29 lines
667 B
Lua
-- example.lua
|
|
version = "1.0.0"
|
|
author = "futriis"
|
|
description = "Example plugin"
|
|
|
|
function on_load()
|
|
plugin_log("info", "Example plugin loaded")
|
|
return true
|
|
end
|
|
|
|
function on_start()
|
|
plugin_log("info", "Example plugin started")
|
|
|
|
-- Получаем коллекцию
|
|
local coll = get_collection("test_db", "test_coll")
|
|
if coll then
|
|
-- Вставляем документ
|
|
coll:insert({name = "test", value = 42})
|
|
plugin_log("info", "Document inserted")
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
function process_data(data)
|
|
plugin_log("debug", "Processing: " .. data)
|
|
return {processed = true, original = data}
|
|
end
|