MongoDB-তে কানেক্টেড ক্লায়েন্ট পেতে, ট্রুতে সেট মান সহ currentOp() ব্যবহার করুন এবং আপনাকে ফিল্ড ক্লায়েন্টের সাহায্যে অ্যারে ফলাফল সেটটি পুনরাবৃত্তি করতে হবে। আসুন প্রথমে currentOp
প্রয়োগ করি> db.currentOp(true)
নিম্নলিখিত আউটপুট. এখানে ক্লায়েন্ট হল 127.0.0.1 যেহেতু আমরা লোকালহোস্ট ব্যবহার করছি। আউটপুট সমস্ত সংযুক্ত ক্লায়েন্ট প্রদর্শন করে
{ "inprog" : [ { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "conn1", "connectionId" : 1, "client" : "127.0.0.1:61787", "appName" : "MongoDB Shell", "clientMetadata" : { "application" : { "name" : "MongoDB Shell" }, "driver" : { "name" : "MongoDB Internal Client", "version" : "4.0.5" }, "os" : { "type" : "Windows", "name" : "Microsoft Windows 10", "architecture" : "x86_64", "version" : "10.0 (build 17134)" } }, "active" : true, "currentOpTime" : "2019-03-30T05:13:34.296+0530", "opid" : 12538, "lsid" : { "id" : UUID("da370b0f-093a-45f3-b1fe-697daca8ccd2"), "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=") }, "secs_running" : NumberLong(0), "microsecs_running" : NumberLong(160815), "op" : "command", "ns" : "admin.$cmd.aggregate", "command" : { "currentOp" : 1, "$all" : true, "lsid" : { "id" : UUID("da370b0f-093a-45f3-b1fe-697daca8ccd2") }, "$db" : "admin" }, "numYields" : 0, "locks" : { }, "waitingForLock" : false, "lockStats" : { } }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "LogicalSessionCacheRefresh", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "SessionKiller", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "TTLMonitor", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "free_mon", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "freemon-0", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "startPeriodicThreadToAbortExpiredTransactions", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "WTCheckpointThread", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "ftdc", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "WTJournalFlusher", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "clientcursormon", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" }, { "host" : "DESKTOP-QN2RB3H:27017", "desc" : "initandlisten", "active" : false, "currentOpTime" : "2019-03-30T05:13:34.296+0530" } ], "ok" : 1 }