At "5.2. Administration Tutorials"
Sub-section: "Terminate Running Operations" - "Available Procedures"
You can add the maxTimeMS field to the command document to set a time limit of 30 milliseconds for the operation:
db.runCommand(
)
Command uses value of 45 and not 30