Selection

1 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€45.20
List Price:  €63.28
You save:  €18.08
£38.77
List Price:  £54.28
You save:  £15.51
CA$70.36
List Price:  CA$98.51
You save:  CA$28.15
A$81.19
List Price:  A$113.68
You save:  A$32.48
S$66.94
List Price:  S$93.72
You save:  S$26.78
HK$387.98
List Price:  HK$543.20
You save:  HK$155.22
CHF 42.15
List Price:  CHF 59.01
You save:  CHF 16.86
NOK kr542.93
List Price:  NOK kr760.15
You save:  NOK kr217.21
DKK kr337.43
List Price:  DKK kr472.43
You save:  DKK kr135
NZ$88.03
List Price:  NZ$123.24
You save:  NZ$35.21
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳6,068.89
List Price:  ৳8,496.94
You save:  ৳2,428.04
₹4,310.27
List Price:  ₹6,034.73
You save:  ₹1,724.45
RM223.35
List Price:  RM312.71
You save:  RM89.36
₦78,934.21
List Price:  ₦110,514.21
You save:  ₦31,580
₨14,032.19
List Price:  ₨19,646.19
You save:  ₨5,614
฿1,709.08
List Price:  ฿2,392.85
You save:  ฿683.77
₺1,897.15
List Price:  ₺2,656.16
You save:  ₺759.01
B$295.66
List Price:  B$413.95
You save:  B$118.29
R973.12
List Price:  R1,362.45
You save:  R389.32
Лв88.52
List Price:  Лв123.94
You save:  Лв35.41
₩73,134.44
List Price:  ₩102,394.07
You save:  ₩29,259.63
₪187.99
List Price:  ₪263.21
You save:  ₪75.21
₱2,869.65
List Price:  ₱4,017.74
You save:  ₱1,148.08
¥7,299.32
List Price:  ¥10,219.64
You save:  ¥2,920.31
MX$1,018.61
List Price:  MX$1,426.13
You save:  MX$407.52
QR182.11
List Price:  QR254.97
You save:  QR72.86
P703.44
List Price:  P984.87
You save:  P281.43
KSh6,463.70
List Price:  KSh9,049.70
You save:  KSh2,586
E£2,564.33
List Price:  E£3,590.27
You save:  E£1,025.93
ብር6,606.81
List Price:  ብር9,250.06
You save:  ብር2,643.25
Kz45,790.84
List Price:  Kz64,110.84
You save:  Kz18,320
CLP$49,561.58
List Price:  CLP$69,390.18
You save:  CLP$19,828.60
CN¥366.89
List Price:  CN¥513.67
You save:  CN¥146.78
RD$3,108.89
List Price:  RD$4,352.70
You save:  RD$1,243.80
DA6,665.16
List Price:  DA9,331.76
You save:  DA2,666.60
FJ$115.50
List Price:  FJ$161.72
You save:  FJ$46.21
Q385.26
List Price:  Q539.40
You save:  Q154.13
GY$10,450.74
List Price:  GY$14,631.88
You save:  GY$4,181.13
ISK kr6,541.19
List Price:  ISK kr9,158.19
You save:  ISK kr2,617
DH474.98
List Price:  DH665.01
You save:  DH190.03
L888.08
List Price:  L1,243.38
You save:  L355.30
ден2,785.18
List Price:  ден3,899.47
You save:  ден1,114.29
MOP$398.05
List Price:  MOP$557.30
You save:  MOP$159.25
N$985.11
List Price:  N$1,379.23
You save:  N$394.12
C$1,838.13
List Price:  C$2,573.53
You save:  C$735.40
रु6,839.53
List Price:  रु9,575.89
You save:  रु2,736.36
S/187.07
List Price:  S/261.91
You save:  S/74.84
K206.31
List Price:  K288.85
You save:  K82.54
SAR187.64
List Price:  SAR262.71
You save:  SAR75.07
ZK1,403.19
List Price:  ZK1,964.58
You save:  ZK561.39
L224.99
List Price:  L315.01
You save:  L90.01
Kč1,134.88
List Price:  Kč1,588.92
You save:  Kč454.04
Ft18,343.73
List Price:  Ft25,682.69
You save:  Ft7,338.96
SEK kr498.25
List Price:  SEK kr697.60
You save:  SEK kr199.34
ARS$53,798.79
List Price:  ARS$75,322.61
You save:  ARS$21,523.82
Bs345.17
List Price:  Bs483.27
You save:  Bs138.09
COP$220,744.08
List Price:  COP$309,059.37
You save:  COP$88,315.29
₡25,693.13
List Price:  ₡35,972.44
You save:  ₡10,279.31
L1,279.54
List Price:  L1,791.47
You save:  L511.92
₲399,722.48
List Price:  ₲559,643.46
You save:  ₲159,920.97
$U2,141.47
List Price:  $U2,998.23
You save:  $U856.75
zł192.08
List Price:  zł268.92
You save:  zł76.84
Already have an account? Log In

Transcript

Now that we have seen prediction, let's see how to use selection. Now the concept is the same thing, you have to specify an object representing conditions. For example, if I want to get all the content from city of Chicago, so I can do the same thing like DB dot contacts dot find. And the first argument would be the selection. And the second argument would be the projection. Let's say for example, I don't want to include the ID, I can simply say ID is zero.

However, we want to specify a condition here. And that condition would be city in Chicago, and save it. And let's go and run the same thing. Mongo x 04 dot js, you can see that we got some records now just to make sure that we see the data properly. That's also called the predict function, save it and re execute the same command. And this time, you can see we got some documents where the city property equals to Chicago, giving a key value pairs like this is equal and of saying city equals to Chicago.

So the same thing can also be represented using city. And then we specify an operator, which is given in the form of another object. So dollar EQ, and then we give Chicago. So now we are saying that city equals to Chicago. So output should remain the same thing. And we got the same thing.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.