Skip to content

Instantly share code, notes, and snippets.

@alkampfergit
alkampfergit / Mongodb: Enable tracking for all queries on all databases
Last active April 12, 2023 08:00
Complete profile of mongodb databases
var mongo = db.getMongo()
var dbs = db.getMongo().getDBNames()
//Step 1 drop all existing profile and recreate profile with bigger collections.
for(var i in dbs){
db = db.getMongo().getDB( dbs[i] );
var name = db.getName();
if (name.startsWith("jarvis"))
{
db.setProfilingLevel(0)
@alkampfergit
alkampfergit / program.cs
Last active August 31, 2023 14:35
Bug in hangfire Mongodb
using Hangfire;
using Hangfire.MemoryStorage;
using Hangfire.Mongo;
using Hangfire.Mongo.Migration.Strategies;
using Hangfire.Mongo.Migration.Strategies.Backup;
namespace ConsoleApp4
{
internal class Program
{