|
Currently server.locks returns a document with a field for each db, but db names can have chars that are not allowed for storage in mongodb ("$", ".")
If we return an array instead of a document then we can save them.
"locks" : {
|
"." : {
|
"timeLockedMicros" : {
|
"R" : NumberLong(0),
|
"W" : NumberLong(10898)
|
},
|
"timeAcquiringMicros" : {
|
"R" : NumberLong(0),
|
"W" : NumberLong(4990)
|
}
|
},
|
"admin" : {
|
"timeLockedMicros" : {
|
"r" : NumberLong(20),
|
"w" : NumberLong(0)
|
},
|
"timeAcquiringMicros" : {
|
"r" : NumberLong(2),
|
"w" : NumberLong(0)
|
}
|
},
|
"local" : {
|
"timeLockedMicros" : {
|
"r" : NumberLong(36),
|
"w" : NumberLong(0)
|
},
|
"timeAcquiringMicros" : {
|
"r" : NumberLong(9),
|
"w" : NumberLong(0)
|
}
|
}
|
should become:
"locks" : [
|
{ "database" : ".",
|
"timeLockedMicros" : {
|
"R" : NumberLong(0),
|
"W" : NumberLong(10898)
|
},
|
"timeAcquiringMicros" : {
|
"R" : NumberLong(0),
|
"W" : NumberLong(4990)
|
}
|
},
|
{ "database" : "admin",
|
"timeLockedMicros" : {
|
"r" : NumberLong(20),
|
"w" : NumberLong(0)
|
},
|
"timeAcquiringMicros" : {
|
"r" : NumberLong(2),
|
"w" : NumberLong(0)
|
}
|
},
|
{ "database" : "local",
|
"timeLockedMicros" : {
|
"r" : NumberLong(36),
|
"w" : NumberLong(0)
|
},
|
"timeAcquiringMicros" : {
|
"r" : NumberLong(9),
|
"w" : NumberLong(0)
|
}
|
}
|
]
|
|