updated config

This commit is contained in:
buenosairesam
2025-08-03 07:22:17 -03:00
parent 2d7de863f3
commit af06c1325e
8 changed files with 45 additions and 68 deletions

View File

@@ -0,0 +1,4 @@
db.getCollection("switch").find({})
.projection({})
.sort({date: -1})
.limit(0)

View File

@@ -0,0 +1,4 @@
db.switch.find(
{ date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } }
).pretty()

View File

@@ -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)

View File

@@ -0,0 +1,4 @@
db.switch.updateMany(
{ task: "9719a462" },
{ $set: { task: "c6b0af75" } }
)

View File

@@ -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" }
}
}
])

View File

@@ -0,0 +1,4 @@
db.switch.updateMany(
{ date: { $gt: ISODate("2025-02-13T11:00:00-03:00") } },
{ $set: { task: "f6f23db6" } }
)

View File

@@ -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" }
}
}
])

View File

@@ -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):