-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
37 lines (23 loc) · 804 Bytes
/
notes.txt
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
db.countries.find({"name": {$regex: "Korea"}}).explain("executionStats")
db.countries.createIndex({"name": 1})
db.countries.find({"name": {$regex: "Korea"}})
db.countries.find({"region":"Americas"}).
count()
db.countries.find({"region": "Asia", "name": {$regex: "Kor"}})
db.countries.countDocuments({"region": "Asia", "name": {$regex: ""}})
db.countries.createIndex({"alpha3Code": 1})
db.countries.getIndexes()
db.countries.find({_id: new ObjectId("651853149f2f79142a681852")})
db.items.aggregate([
{ $match: { tag: 'blue' } },
{ $lookup: your_lookup_command }
])
db.countries.aggregate([
{ $match: { _id: new ObjectId("651853149f2f79142a681852")}},
{ $lookup: {
from: "countries",
localField: "borders",
foreignField: "alpha3Code",
as: "border_country"
}}
])