//分组查出这段时间内的慢sql
db.system.profile.aggregate(
{KaTeX parse error: Expected '}', got 'EOF' at end of input: match:{ts : {gt : new ISODate(“2021-12-20T00:00:00Z”) ,KaTeX parse error: Expected 'EOF', got '}' at position 41: …-17T09:40:00Z")}̲}}, {group:{_id:{op:‘
o
p
′
,
n
s
:
′
op',ns:'
op′,ns:′ns’},doc:{
f
i
r
s
t
:
"
first: "
first:"$ROOT"}}},
)
db.system.profile.find(
{
ts : {
$gt : new ISODate(“2021-12-20T00:00:00Z”) ,
$lt : new ISODate(“2022-05-17T09:40:00Z”)
}
}
,{op:1,ns:1,command:1,millis:1,ts:1}).sort( { millis : -1 } )
//具体的慢sql
db.system.profile.find(
{
ts : {
$gt : new ISODate(“2021-12-20T00:00:00Z”) ,
$lt : new ISODate(“2022-05-17T09:40:00Z”)
},
ns:‘rsc_dev00.newDispute’
}
,{op:1,ns:1,command:1,millis:1,ts:1,docsExamined:1}).sort( { millis : -1 } )