com.mongodb.MongoQueryException: Query failed with error code 73 and error message ‘Invalid collection name: admin.$cmd.sys.inprog’ on server **.com:27017
Hi Majeed,
The find() command introduced in MongoDB v3.2, that is used by MongoDB Java Driver v3.2.x does not allow querying on the system collection. You could also observe this behaviour via mongo shell by executing db.$cmd.sys.inprog.find()
in v3.2:
> db.$cmd.sys.inprog.find()
2016-05-06T10:01:47.893+1000 I NETWORK [thread1] DBClientCursor::init call() failed
Error: error doing query: failed
Please use currentOp() command instead, as you have noticed:
mongoClient.getDatabase("admin").runCommand(new Document("currentOp", Boolean.TRUE));
See MongoDB Java Driver: running a command for more info.
Kind Regards,
Wan.