68
68
"mode" : " absolute" ,
69
69
"steps" : [
70
70
{
71
- "color" : " red"
71
+ "color" : " red" ,
72
+ "value" : null
72
73
},
73
74
{
74
75
"color" : " red" ,
101
102
"pluginVersion" : " 10.4.2" ,
102
103
"targets" : [
103
104
{
105
+ "collection" : " movies" ,
104
106
"datasource" : {
105
107
"type" : " mongodb-grafana-datasource" ,
106
108
"uid" : " fdkn0wi0apkw0c"
107
109
},
108
- "queryText": "{\n collection: \"movies\",\n aggregations: [\n {\n $match: {\n released: {\n $gte: new Date($from),\n $lte: new Date($to),\n },\n },\n },\n {\n $group: {\n _id: {\n year: {\n $year: \"$released\",\n },\n month: {\n $month: \"$released\",\n },\n },\n __value: {\n $sum: 1,\n },\n },\n },\n {\n $addFields: {\n __name: { $literal: \"movies in month\" },\n __timestamp: {\n $dateFromString: {\n dateString: {\n $concat: [\n {\n $toString: \"$_id.year\",\n },\n \"-\",\n {\n $toString: {\n $cond: {\n if: {\n $lte: [\"$_id.month\", 9],\n },\n then: \"0\",\n else: \"\",\n },\n },\n },\n {\n $toString: \"$_id.month\",\n },\n \"-01\",\n ],\n },\n format: \"%Y-%m-%d\",\n },\n },\n },\n },\n {\n $sort: {\n __timestamp: 1,\n },\n },\n {\n $project: {\n _id: 0,\n },\n },\n ],\n}",
110
+ "queryText": "[\n {\n $match: {\n released: {\n $gte: new Date($from),\n $lte: new Date($to),\n },\n },\n },\n {\n $group: {\n _id: {\n year: {\n $year: \"$released\",\n },\n month: {\n $month: \"$released\",\n },\n },\n __value: {\n $sum: 1,\n },\n },\n },\n {\n $addFields: {\n __name: { $literal: \"movies in month\" },\n __timestamp: {\n $dateFromString: {\n dateString: {\n $concat: [\n {\n $toString: \"$_id.year\",\n },\n \"-\",\n {\n $toString: {\n $cond: {\n if: {\n $lte: [\"$_id.month\", 9],\n },\n then: \"0\",\n else: \"\",\n },\n },\n },\n {\n $toString: \"$_id.month\",\n },\n \"-01\",\n ],\n },\n format: \"%Y-%m-%d\",\n },\n },\n },\n },\n {\n $sort: {\n __timestamp: 1,\n },\n },\n {\n $project: {\n _id: 0,\n },\n },\n ]",
109
111
"queryType" : " timeserie" ,
110
112
"refId" : " A"
111
113
}
160
162
"mode" : " absolute" ,
161
163
"steps" : [
162
164
{
163
- "color" : " green"
165
+ "color" : " green" ,
166
+ "value" : null
164
167
},
165
168
{
166
169
"color" : " red" ,
192
195
},
193
196
"targets" : [
194
197
{
198
+ "collection" : " movies" ,
195
199
"datasource" : {
196
200
"type" : " mongodb-grafana-datasource" ,
197
201
"uid" : " fdkn0wi0apkw0c"
198
202
},
199
- "queryText": "{\n collection: \"movies\",\n aggregations: [\n {\n $match: {\n released: {\n $gte: new Date($from),\n $lte: new Date($to),\n },\n },\n },\n {\n $group: {\n _id: {\n year: {\n $year: \"$released\",\n },\n month: {\n $month: \"$released\",\n },\n },\n __value: {\n $sum: 1,\n },\n },\n },\n {\n $addFields: {\n __name: { $literal: \"movies in month\" },\n __timestamp: {\n $dateFromString: {\n dateString: {\n $concat: [\n {\n $toString: \"$_id.year\",\n },\n \"-\",\n {\n $toString: {\n $cond: {\n if: {\n $lte: [\"$_id.month\", 9],\n },\n then: \"0\",\n else: \"\",\n },\n },\n },\n {\n $toString: \"$_id.month\",\n },\n \"-01\",\n ],\n },\n format: \"%Y-%m-%d\",\n },\n },\n },\n },\n {\n $sort: {\n __timestamp: 1,\n },\n },\n {\n $project: {\n _id: 0,\n },\n },\n ],\n}",
203
+ "queryText": "[\n {\n $match: {\n released: {\n $gte: new Date($from),\n $lte: new Date($to),\n },\n },\n },\n {\n $group: {\n _id: {\n year: {\n $year: \"$released\",\n },\n month: {\n $month: \"$released\",\n },\n },\n __value: {\n $sum: 1,\n },\n },\n },\n {\n $addFields: {\n __name: { $literal: \"movies in month\" },\n __timestamp: {\n $dateFromString: {\n dateString: {\n $concat: [\n {\n $toString: \"$_id.year\",\n },\n \"-\",\n {\n $toString: {\n $cond: {\n if: {\n $lte: [\"$_id.month\", 9],\n },\n then: \"0\",\n else: \"\",\n },\n },\n },\n {\n $toString: \"$_id.month\",\n },\n \"-01\",\n ],\n },\n format: \"%Y-%m-%d\",\n },\n },\n },\n },\n {\n $sort: {\n __timestamp: 1,\n },\n },\n {\n $project: {\n _id: 0,\n },\n },\n]\n",
200
204
"queryType" : " timeserie" ,
201
205
"refId" : " A"
202
206
},
203
207
{
208
+ "collection" : " movies" ,
204
209
"datasource" : {
205
210
"type" : " mongodb-grafana-datasource" ,
206
211
"uid" : " fdkn0wi0apkw0c"
207
212
},
208
213
"hide" : false ,
209
- "queryText": "{\n \"collection\": \"movies\",\n \"aggregations\": [\n {\n \"$match\": {\n \"released\": {\n \"$gte\": $from,\n \"$lte\": $to\n },\n \"genres\": { \"$elemMatch\": { \"$eq\": \"Comedy\" } }\n }\n },\n {\n \"$group\": {\n \"_id\": {\n \"year\": { \"$year\": \"$released\" },\n \"month\": { \"$month\": \"$released\" }\n },\n \"__value\": { \"$sum\": 1 }\n }\n },\n {\n \"$addFields\": {\n \"__name\": { \"$literal\": \"genre\" },\n \"__timestamp\": {\n \"$dateFromString\": {\n \"dateString\": {\n \"$concat\": [\n { \"$toString\": \"$_id.year\" },\n \"-\",\n {\n \"$toString\": {\n \"$cond\": {\n \"if\": { \"$lte\": [\"$_id.month\", 9] },\n \"then\": \"0\",\n \"else\": \"\"\n }\n }\n },\n { \"$toString\": \"$_id.month\" },\n \"-01\"\n ]\n },\n \"format\": \"%Y-%m-%d\"\n }\n }\n }\n },\n {\n \"$sort\": { \"__timestamp\": 1 }\n },\n {\n \"$project\": { \"_id\": 0 }\n }\n ]\n}\n",
214
+ "queryText": " [\n {\n \"$match\": {\n \"released\": {\n \"$gte\": $from,\n \"$lte\": $to\n },\n \"genres\": { \"$elemMatch\": { \"$eq\": \"Comedy\" } }\n }\n },\n {\n \"$group\": {\n \"_id\": {\n \"year\": { \"$year\": \"$released\" },\n \"month\": { \"$month\": \"$released\" }\n },\n \"__value\": { \"$sum\": 1 }\n }\n },\n {\n \"$addFields\": {\n \"__name\": { \"$literal\": \"genre\" },\n \"__timestamp\": {\n \"$dateFromString\": {\n \"dateString\": {\n \"$concat\": [\n { \"$toString\": \"$_id.year\" },\n \"-\",\n {\n \"$toString\": {\n \"$cond\": {\n \"if\": { \"$lte\": [\"$_id.month\", 9] },\n \"then\": \"0\",\n \"else\": \"\"\n }\n }\n },\n { \"$toString\": \"$_id.month\" },\n \"-01\"\n ]\n },\n \"format\": \"%Y-%m-%d\"\n }\n }\n }\n },\n {\n \"$sort\": { \"__timestamp\": 1 }\n },\n {\n \"$project\": { \"_id\": 0 }\n }\n ]\n",
210
215
"queryType" : " timeserie" ,
211
216
"refId" : " B"
212
217
}
243
248
},
244
249
"id" : 5 ,
245
250
"options" : {
246
- "displayLabels" : [" name" ],
251
+ "displayLabels" : [
252
+ " name"
253
+ ],
247
254
"legend" : {
248
255
"displayMode" : " list" ,
249
256
"placement" : " bottom" ,
250
257
"showLegend" : true
251
258
},
252
259
"pieType" : " pie" ,
253
260
"reduceOptions" : {
254
- "calcs" : [" lastNotNull" ],
261
+ "calcs" : [
262
+ " lastNotNull"
263
+ ],
255
264
"fields" : " " ,
256
265
"values" : true
257
266
},
263
272
"pluginVersion" : " 10.4.2" ,
264
273
"targets" : [
265
274
{
275
+ "collection" : " movies" ,
266
276
"datasource" : {
267
277
"type" : " mongodb-grafana-datasource" ,
268
278
"uid" : " fdkn0wi0apkw0c"
269
279
},
270
- "queryText" : " { \n \" collection \" : \" movies \" , \n \" aggregations \" : [\n {\n \" $unwind\" : {\n \" path\" : \" $genres\"\n }\n },\n {\n \" $project\" : {\n \" genres\" : 1\n }\n },\n {\n \" $group\" : {\n \" _id\" : \" $genres\" ,\n \" __value\" : {\n \" $sum\" : 1\n }\n }\n }\n ] \n } " ,
280
+ "queryText" : " [\n {\n \" $unwind\" : {\n \" path\" : \" $genres\"\n }\n },\n {\n \" $project\" : {\n \" genres\" : 1\n }\n },\n {\n \" $group\" : {\n \" _id\" : \" $genres\" ,\n \" __value\" : {\n \" $sum\" : 1\n }\n }\n }\n ] " ,
271
281
"queryType" : " table" ,
272
282
"refId" : " A"
273
283
}
311
321
"mode" : " absolute" ,
312
322
"steps" : [
313
323
{
314
- "color" : " green"
324
+ "color" : " green" ,
325
+ "value" : null
315
326
},
316
327
{
317
328
"color" : " red" ,
334
345
"footer" : {
335
346
"countRows" : false ,
336
347
"fields" : " " ,
337
- "reducer" : [" sum" ],
348
+ "reducer" : [
349
+ " sum"
350
+ ],
338
351
"show" : false
339
352
},
340
353
"showHeader" : true
341
354
},
342
355
"pluginVersion" : " 10.4.2" ,
343
356
"targets" : [
344
357
{
358
+ "collection" : " movies" ,
345
359
"datasource" : {
346
360
"type" : " mongodb-grafana-datasource" ,
347
361
"uid" : " fdkn0wi0apkw0c"
348
362
},
349
- "queryText" : " { \n collection: \" movies \" , \n aggregations: [\n {\n '$match': {\n 'released': {\n '$gte': new Date('Sat, 01 Jan 2000 00:00:00 GMT'), \n '$lte': new Date('Tue, 01 Jan 2002 00:00:00 GMT')\n }\n }\n }, {\n '$project': {\n 'title': 1, \n 'year': 1, \n 'plot': 1\n }\n }\n ] \n } " ,
363
+ "queryText" : " [\n {\n '$match': {\n 'released': {\n '$gte': new Date('Sat, 01 Jan 2000 00:00:00 GMT'), \n '$lte': new Date('Tue, 01 Jan 2002 00:00:00 GMT')\n }\n }\n }, {\n '$project': {\n 'title': 1, \n 'year': 1, \n 'plot': 1\n }\n }\n ] " ,
350
364
"queryType" : " table" ,
351
365
"refId" : " A"
352
366
}
355
369
"type" : " table"
356
370
}
357
371
],
372
+ "refresh" : " " ,
358
373
"schemaVersion" : 39 ,
359
374
"tags" : [],
360
375
"templating" : {
368
383
"timezone" : " browser" ,
369
384
"title" : " mflix" ,
370
385
"uid" : " bdkpj0btmpr7kc" ,
371
- "version" : 19 ,
386
+ "version" : 31 ,
372
387
"weekStart" : " "
373
- }
388
+ }
0 commit comments