Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 866 characters in body
Source Link
Velkumar
  • 41
  • 1
  • 2
  • 7

Using the Mongo Java API I can run the currentOp() command like this:

MongoClient mongoClient = null;
mongoClient = new MongoClient( "127.0.0.1", 27017);
db = mongoClient.getDB("admin");
db.command("currentOp");

But I only get details of current operations. I need to get details of idle connections too.

With reference with this
https://docs.mongodb.com/v3.0/reference/method/db.currentOp/#currentop-examples

Behavior

If you pass in true to db.currentOp(), the method returns information on all operations, including operations on idle connections and system operations.

db.currentOp(true) Passing in true is equivalent to passing in a query document of { '$all': true }.

If you pass a query document to db.currentOp(), the output returns information only for the current operations that match the query. You can query on the Output Fields. See Examples.

You can also specify { '$all': true } query document to return information on all in-progress operations, including operations on idle connections and system operations. If the query document includes '$all': true as well as other query conditions, only the '$all': true applies.

While using this command db.command("currentOp(true)");, I get an exception like this:

"ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

Using the Mongo Java API I can run the currentOp() command like this:

MongoClient mongoClient = null;
mongoClient = new MongoClient( "127.0.0.1", 27017);
db = mongoClient.getDB("admin");
db.command("currentOp");

But I only get details of current operations. I need to get details of idle connections too.

While using this command db.command("currentOp(true)");, I get an exception like this:

"ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

Using the Mongo Java API I can run the currentOp() command like this:

MongoClient mongoClient = null;
mongoClient = new MongoClient( "127.0.0.1", 27017);
db = mongoClient.getDB("admin");
db.command("currentOp");

But I only get details of current operations. I need to get details of idle connections too.

With reference with this
https://docs.mongodb.com/v3.0/reference/method/db.currentOp/#currentop-examples

Behavior

If you pass in true to db.currentOp(), the method returns information on all operations, including operations on idle connections and system operations.

db.currentOp(true) Passing in true is equivalent to passing in a query document of { '$all': true }.

If you pass a query document to db.currentOp(), the output returns information only for the current operations that match the query. You can query on the Output Fields. See Examples.

You can also specify { '$all': true } query document to return information on all in-progress operations, including operations on idle connections and system operations. If the query document includes '$all': true as well as other query conditions, only the '$all': true applies.

While using this command db.command("currentOp(true)");, I get an exception like this:

"ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

improved code formatting and wording / sentence structure
Source Link

Using the Mongo Java api iAPI I can run the currentOp() command like MongoClient mongoClient = null; mongoClient = new MongoClient( "127.0.0.1", 27017); db = mongoClient.getDB("admin"); db.command("currentOp"); this:

MongoClient mongoClient = null;
mongoClient = new MongoClient( "127.0.0.1", 27017);
db = mongoClient.getDB("admin");
db.command("currentOp");

But i gotI only get details of current operations details only. But iI need idle connectionto get details of idle connections too with the commands. while

While using the followingthis command db.command("currentOp(true)"); i receives db.command("currentOp(true)");, I get an exception like "ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

Pl suggest any solutions this:

Thanks in Advance, Velkumar

"ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

Using the Mongo Java api i can run currentOp() command like MongoClient mongoClient = null; mongoClient = new MongoClient( "127.0.0.1", 27017); db = mongoClient.getDB("admin"); db.command("currentOp");

But i got only current operations details only. But i need idle connection details too with the commands. while using the following command db.command("currentOp(true)"); i receives exception like "ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

Pl suggest any solutions

Thanks in Advance, Velkumar

Using the Mongo Java API I can run the currentOp() command like this:

MongoClient mongoClient = null;
mongoClient = new MongoClient( "127.0.0.1", 27017);
db = mongoClient.getDB("admin");
db.command("currentOp");

But I only get details of current operations. I need to get details of idle connections too.

While using this command db.command("currentOp(true)");, I get an exception like this:

"ok" : 0.0 , "errmsg" : "no such command: 'currentOp(true)', bad cmd: '{ currentOp(true): true }'" , "code" : 59}

edited tags
Link
Velkumar
  • 41
  • 1
  • 2
  • 7
Source Link
Velkumar
  • 41
  • 1
  • 2
  • 7
Loading