diff --git a/dmapp/def/all sorted by date.js b/dmapp/def/all sorted by date.js new file mode 100644 index 0000000..c0bfd64 --- /dev/null +++ b/dmapp/def/all sorted by date.js @@ -0,0 +1,4 @@ +db.getCollection("switch").find({}) + .projection({}) + .sort({date: -1}) + .limit(0) \ No newline at end of file diff --git a/dmapp/def/find all after date.js b/dmapp/def/find all after date.js new file mode 100644 index 0000000..ec87a64 --- /dev/null +++ b/dmapp/def/find all after date.js @@ -0,0 +1,4 @@ +db.switch.find( + { date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } } +).pretty() + diff --git a/dmapp/def/find task between dates.js b/dmapp/def/find task between dates.js new file mode 100644 index 0000000..8261a60 --- /dev/null +++ b/dmapp/def/find task between dates.js @@ -0,0 +1,10 @@ +db.getCollection("switch").find({ + task: { $in: ["f217b606", "7422cfe3", "acbd9f7f", "9719a462", "c6b0af75", "be7e496f", "51c5b6d6"] }, + date: { + $gte: ISODate("2025-02-03T00:00:00-03:00"), + $lt: ISODate("2025-02-05T00:00:00-03:00") + } +}) +.projection({}) +.sort({ date: -1 }) +.limit(0) \ No newline at end of file diff --git a/dmapp/def/replace task id.js b/dmapp/def/replace task id.js new file mode 100644 index 0000000..5d647c8 --- /dev/null +++ b/dmapp/def/replace task id.js @@ -0,0 +1,4 @@ +db.switch.updateMany( + { task: "9719a462" }, + { $set: { task: "c6b0af75" } } +) \ No newline at end of file diff --git a/dmapp/def/sum active tasks between dates.js b/dmapp/def/sum active tasks between dates.js new file mode 100644 index 0000000..5d99ff3 --- /dev/null +++ b/dmapp/def/sum active tasks between dates.js @@ -0,0 +1,18 @@ +db.getCollection("switch").aggregate([ + { + $match: { + task: { $in: ["1cb1f8d1", "7c580d3d", "810a29dc", "b4378ac5", "d0d914b3", "db2179e1"] }, + date: { + $gte: ISODate("2025-02-01T00:00:00-03:00"), + $lt: ISODate("2025-02-17T00:00:00-03:00") + }, + workspace: { $in: ["Think", "Plan", "Work"] } // New filter for workspace + } + }, + { + $group: { + _id: null, + totalDelta: { $sum: "$delta" } + } + } +]) \ No newline at end of file diff --git a/dmapp/def/update task after date.js b/dmapp/def/update task after date.js new file mode 100644 index 0000000..426211a --- /dev/null +++ b/dmapp/def/update task after date.js @@ -0,0 +1,4 @@ +db.switch.updateMany( + { date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } }, + { $set: { task: "f6f23db6" } } +) \ No newline at end of file diff --git a/dmapp/dmcore/queries b/dmapp/dmcore/queries deleted file mode 100644 index b76a014..0000000 --- a/dmapp/dmcore/queries +++ /dev/null @@ -1,67 +0,0 @@ - -// all sorted by date - -db.getCollection("switch").find({}) - .projection({}) - .sort({date: -1}) - .limit(0) - - -// replace task id - -db.switch.updateMany( - { task: "9719a462" }, - { $set: { task: "c6b0af75" } } -) - - -// find all after date - -db.switch.find( - { date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } } -).pretty() - - -// update task after date - -db.switch.updateMany( - { date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } }, - { $set: { task: "f6f23db6" } } -) - -// find tasks between dates - -db.getCollection("switch").find({ - task: { $in: ["f217b606", "7422cfe3", "acbd9f7f", "9719a462", "c6b0af75", "be7e496f", "51c5b6d6"] }, - date: { - $gte: ISODate("2025-02-03T00:00:00-03:00"), - $lt: ISODate("2025-02-05T00:00:00-03:00") - } -}) -.projection({}) -.sort({ date: -1 }) -.limit(0) - -// sum active task between dates - -db.getCollection("switch").aggregate([ - { - $match: { - task: { $in: ["f217b606", "7422cfe3", "acbd9f7f", "9719a462", "c6b0af75", "be7e496f", "51c5b6d6"] }, - date: { - $gte: ISODate("2025-02-01T00:00:00-03:00"), - $lt: ISODate("2025-02-17T00:00:00-03:00") - }, - workspace: { $in: ["Think", "Plan", "Work"] } // New filter for workspace - } - }, - { - $group: { - _id: null, - totalDelta: { $sum: "$delta" } - } - } -]) - - - diff --git a/dmapp/dmweb/get_period_times.py b/dmapp/dmweb/get_period_times.py index 39bb3e2..c64b51f 100644 --- a/dmapp/dmweb/get_period_times.py +++ b/dmapp/dmweb/get_period_times.py @@ -13,7 +13,7 @@ db = client.deskmeter switches = db.switch -task_file = "/home/mariano/LETRAS/org/task/main" +task_file = "/home/mariano/LETRAS/adm/task/main" def task_or_none(task=None):