{
"app":"test",
"config":
{
"levels" :[
[5 ,5 ,10 ,10 ,2 ,3 ,1 ,3 ,1 ,5 ,10 ,1],
[5 ,10 ,8 ,3 ,1 ,5 ,1 ,5 ,2 ,5 ,5 ,1],
[10 ,5 ,7 ,6 ,2 ,2 ,1 ,5 ,2 ,5 ,8 ,1],
[15 ,5 ,5 ,10 ,1 ,5 ,1 ,5 ,2 ,5 ,7 ,1],
[5 ,15 ,10 ,6 ,1 ,3 ,1 ,5 ,2 ,5 ,10 ,1]
],
"zones": {
"one": "XXXXXXX",
"two": "XXXXXX",
"three": "XXXXXX"
},
"frequency":120
}
}
{ _id: ObjectId("5624396d4837a389fbc4e503"), app: "test", objectId: "be15218617", config: { zones: { three: "XXXXXX", one: "XXXXXXX", two: "XXXXXX" }, levels: [ null, [ null, 5, 5, 10, 10, 2, 3, 1, 3, 1, 5, 10, 1 ], [ null, 5, 10, 8, 3, 1, 5, 1, 5, 2, 5, 5, 1 ], [ null, 10, 5, 7, 6, 2, 2, 1, 5, 2, 5, 8, 1 ], [ null, 15, 5, 5, 10, 1, 5, 1, 5, 2, 5, 7, 1 ], [ null, 5, 15, 10, 6, 1, 3, 1, 5, 2, 5, 10, 1 ] ], frequency: 120 } }
local in_data = coronium.input()
local obj = coronium.asJson(in_data)
local answer = coronium.mongo:createObject( "dsc", in_data)
if not answer.error then
coronium.error(answer.error)
end
coronium.output(coronium.answer(answer))
local coronium = require( "mod_coronium" )
local globals = require( "globals" )
local obj = {app="test",config= { levels = { {5 ,5 ,10 ,10 ,2 ,3 ,1 ,3 ,1 ,5 ,10 ,1},
{5 ,10 ,8 ,3 ,1 ,5 ,1 ,5 ,2 ,5 ,5 ,1}, {10 ,5 ,7 ,6 ,2 ,2 ,1 ,5 ,2 ,5 ,8 ,1}, {15 ,5 ,5 ,10 ,1 ,5 ,1 ,5 ,2 ,5 ,7 ,1}, {5 ,15 ,10 ,6 ,1 ,3 ,1 ,5 ,2 ,5 ,10 ,1} },
zones= { one= "XXXXXXX", two= "XXXXXX", three= "XXXXXX" }, frequency=120 }}local function _callback(e) print("callback") --dump(e)endcoronium:init( { appId = globals.appid, apiKey = globals.apikey } )coronium:run( "dsc_create", obj, _callback )