-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmulti_queries.json
More file actions
78 lines (78 loc) · 1.7 KB
/
multi_queries.json
File metadata and controls
78 lines (78 loc) · 1.7 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"queries": [
{
"name": "orders_find_by_customer",
"database": "ecommerce",
"collection": "orders",
"operation": "find",
"filter": {
"customer_id": "<int>",
"status": "<string>"
},
"projection": {
"order_id": 1,
"customer_id": 1,
"status": 1,
"total_amount": 1,
"_id": 0
},
"limit": 10
},
{
"name": "orders_aggregate_top_cities",
"database": "ecommerce",
"collection": "orders",
"operation": "aggregate",
"pipeline": [
{"$match": {"is_expedited_shipping": true}},
{"$group": {"_id": "$shipping_city", "total_revenue": {"$sum": "$total_amount"}, "avg_items": {"$avg": "$items_count"}}},
{"$sort": {"total_revenue": -1}},
{"$limit": 5}
]
},
{
"name": "orders_update_status",
"database": "ecommerce",
"collection": "orders",
"operation": "updateOne",
"filter": {
"order_id": "<int>"
},
"update": {
"$set": {
"status": "shipped"
}
}
},
{
"name": "customers_find_region",
"database": "ecommerce",
"collection": "customers",
"operation": "find",
"filter": {
"region": "<string>"
},
"projection": {
"customer_id": 1,
"email": 1,
"region": 1,
"_id": 0
},
"limit": 20
},
{
"name": "customers_update_ltv",
"database": "ecommerce",
"collection": "customers",
"operation": "update",
"filter": {
"customer_id": "<int>"
},
"update": {
"$inc": {
"lifetime_value": 5
}
}
}
]
}