1
2
3
4
5
|
MongoDB shell version: 2.4.7
connecting to:
test
> db.stu.count()
10
>
|
1
2
3
4
|
cat
stu.js
var total = db.stu.count();
printjson(
'total count of stu is:'
+ total);
printjson(
'----------------'
);
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
db.currentOp()
{
"inprog"
: [
{
"opid"
: 62475494,
"active"
:
true
,
"secs_running"
: 2,
"op"
:
"getmore"
,
"ns"
:
"local.oplog.rs"
,
"query"
: {
},
"client"
:
"192.168.129.21:33065"
,
"desc"
:
"conn1938595"
,
"threadId"
:
"0x40458940"
,
"connectionId"
: 1938595,
"waitingForLock"
:
false
,
"numYields"
: 0,
"lockStats"
: {
"timeLockedMicros"
: {
"r"
: NumberLong(83),
"w"
: NumberLong(0)
},
"timeAcquiringMicros"
: {
"r"
: NumberLong(8),
"w"
: NumberLong(0)
}
}
}
]
}
|
1
|
> db.killOp(1234/*opid*/)
|