PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 29th of June, 2021

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:09:09] <Yukkuri> hi, is it possible to add N months to a date with mongo <5.0 without also introducing temporary aggregation fields? I've got pretty close with {$mergeObjects: [{$dateToParts: {date: "$conditions.start_date"}}, {month: "$conditions.months"}]} -- but i'm not sure how to use it with $dateFromParts now
[02:13:41] <Yukkuri> i suppose i can do {$set: {foo: {$mergeObjects from above}}} and then {$set: {foo: {$dateFromParts: "$foo"}}} , but i wonder if it is only way
[02:24:06] <Yukkuri> {$let: {vars: {foo: {$mergeObjects: [{$dateToParts: {date: "$conditions.start_date"}}, {month: "$conditions.months"}]}}, in: {$dateFromParts: {year: "$$foo.year", month: "$$foo.month", day: "$$foo.day", hour: "$$foo.hour", minute: "$$foo.minute", second: "$$foo.second", millisecond: "$$foo.millisecond"}} }} -- would work, but a bit verbose
[02:37:54] <Yukkuri> also noticed a mistake, it should be {month: {$add: ["$conditions._months", {$month: "$conditions.start_date"}]}} in second element of $mergeObjects
[14:23:48] <nukeu666> I have a mongo db deployed via kubernetes, it had some default user/pass but has got lost. How can i run mongo with auth disabled so the pwd can be reset?