Skip to content

Commit 15be5f7

Browse files
CLOUDP-73368: fixing the Operation struct in the atlas go client (#138)
2 parents ac3833a + 728c457 commit 15be5f7

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

mongodbatlas/performance_advisor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ type Shape struct {
6262

6363
// Operation represents a document with specific information and log lines for individual queries.
6464
type Operation struct {
65-
Raw string `json:"raw,omitempty"` // Raw log line produced by the query.
66-
Stats Stats `json:"stats,omitempty"` // Query statistics.
67-
Predicates []map[string]map[string]string `json:"predicates,omitempty"` // Documents containing the search criteria used by the query.
65+
Raw string `json:"raw,omitempty"` // Raw log line produced by the query.
66+
Stats Stats `json:"stats,omitempty"` // Query statistics.
67+
Predicates []map[string]interface{} `json:"predicates,omitempty"` // Documents containing the search criteria used by the query.
6868
}
6969

7070
// Stats represents query statistics.

mongodbatlas/performance_advisor_test.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ func TestPerformanceAdvisor_GetSuggestedIndexes(t *testing.T) {
122122
"inefficiencyScore" : 50000,
123123
"namespace" : "test.users",
124124
"operations" : [ {
125-
"predicates" : [{ "find" : { "emails" : "[email protected]" } }],
126125
"raw" : "2018-08-15T17:14:11.115+0000 I COMMAND [conn4576] command test.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"1a4e71d3-9b67-4e9c-b078-9fdf3fae9091\") }, $clusterTime: { clusterTime: Timestamp(1534353241, 1), signature: { hash: BinData(0, AB91938B7CF7BC87994A2909A98D87F29101EFA0), keyId: 6589681559618453505 } }, $db: \"test\" } planSummary: COLLSCAN keysExamined:0 docsExamined:50000 cursorExhausted:1 numYields:391 nreturned:1 reslen:339 locks:{ Global: { acquireCount: { r: 784 } }, Database: { acquireCount: { r: 392 } }, Collection: { acquireCount: { r: 392 } } } protocol:op_msg 34ms",
127126
"stats" : {
128127
"ms" : 34,
@@ -131,8 +130,7 @@ func TestPerformanceAdvisor_GetSuggestedIndexes(t *testing.T) {
131130
"ts" : 1534353251147
132131
}
133132
}, {
134-
"predicates" : [{ "find" : { "emails" : "[email protected]" } }],
135-
"raw" : "2018-08-15T17:14:18.665+0000 I COMMAND [conn4576] command test.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"1a4e71d3-9b67-4e9c-b078-9fdf3fae9091\") }, $clusterTime: { clusterTime: Timestamp(1534353241, 1), signature: { hash: BinData(0, AB91938B7CF7BC87994A2909A98D87F29101EFA0), keyId: 6589681559618453505 } }, $db: \"test\" } planSummary: COLLSCAN keysExamined:0 docsExamined:50000 cursorExhausted:1 numYields:390 nreturned:1 reslen:342 locks:{ Global: { acquireCount: { r: 782 } }, Database: { acquireCount: { r: 391 } }, Collection: { acquireCount: { r: 391 } } } protocol:op_msg 36ms",
133+
"raw" : "2018-08-15T17:14:18.665+0000 I COMMAND [conn4576] command test.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"1a4e71d3-9b67-4e9c-b078-9fdf3fae9091\") }, $clusterTime: { clusterTime: Timestamp(1534353241, 1), signature: { hash: BinData(0, AB91938B7CF7BC87994A2909A98D87F29101EFA0), keyId: 6589681559618453505 } }, $db: \"test\" } planSummary: COLLSCAN keysExamined:0 docsExamined:50000 cursorExhausted:1 numYields:390 nreturned:1 reslen:342 locks:{ Global: { acquireCount: { r: 782 } }, Database: { acquireCount: { r: 391 } }, Collection: { acquireCount: { r: 391 } } } protocol:op_msg 36ms",
136134
"stats" : {
137135
"ms" : 36,
138136
"nReturned" : 1,
@@ -210,9 +208,6 @@ func TestPerformanceAdvisor_GetSuggestedIndexes(t *testing.T) {
210208
NScanned: 50000,
211209
TS: 1534353251147,
212210
},
213-
Predicates: []map[string]map[string]string{
214-
{"find": {"emails": "[email protected]"}},
215-
},
216211
},
217212
{
218213
Raw: "2018-08-15T17:14:18.665+0000 I COMMAND [conn4576] command test.users appName: \"MongoDB Shell\" command: find { find: \"users\", filter: { emails: \"[email protected]\" }, lsid: { id: UUID(\"1a4e71d3-9b67-4e9c-b078-9fdf3fae9091\") }, $clusterTime: { clusterTime: Timestamp(1534353241, 1), signature: { hash: BinData(0, AB91938B7CF7BC87994A2909A98D87F29101EFA0), keyId: 6589681559618453505 } }, $db: \"test\" } planSummary: COLLSCAN keysExamined:0 docsExamined:50000 cursorExhausted:1 numYields:390 nreturned:1 reslen:342 locks:{ Global: { acquireCount: { r: 782 } }, Database: { acquireCount: { r: 391 } }, Collection: { acquireCount: { r: 391 } } } protocol:op_msg 36ms",
@@ -222,9 +217,6 @@ func TestPerformanceAdvisor_GetSuggestedIndexes(t *testing.T) {
222217
NScanned: 50000,
223218
TS: 1534353258697,
224219
},
225-
Predicates: []map[string]map[string]string{
226-
{"find": {"emails": "[email protected]"}},
227-
},
228220
},
229221
},
230222
},

0 commit comments

Comments
 (0)