-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmongodb_query.js
43 lines (36 loc) · 1.25 KB
/
mongodb_query.js
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
db.getCollection('Users').aggregate(
[
{ $project: {
email: "$email" ,
fullname: { $concat: [ "$th_firstname", " - ", "$th_lastname" ] } ,
age: "$age"
}},
{
$match: {
email: "[email protected]",
$or: [ { age: "19" } ]
}},
]
)
//db.getCollection('Users').aggregate([
// { $match: { $and: [{ role: 'Production' },{ th_prefix: 'นาย'},{reg_date: { $gte: '2020-09-10T00:00:00.000Z' , $lte:'2020-09-10T00:00:00.000Z' }}]}},
// { $project: {
// _id : "$_id",
// th_prefix : "$th_prefix",
// fullnameTH: { $concat: ["$th_firstname", " ", "$th_lastname" ] } ,
// eng_prefix : "$eng_prefix",
// fullnameENG: { $concat:["$eng_firstname", " ", "$eng_lastname" ] } ,
// nationality: "$nationality",
// phone_number: "$phone_number",
// phone_number_famaily: "$phone_number_famaily",
// person_relationship:"$person_relationship",
// eng_address:"$eng_address",
// date_birthday:"$date_birthday",
// age:"$age",
// degree_education:"$degree_education",
// majoy_education:"$majoy_education",
// gpa:"$gpa",
// createdDate: "$createdAt",
// count:"$count"
// }}
// ])