-
Notifications
You must be signed in to change notification settings - Fork 2
/
studentdetails-count.get.hl
67 lines (58 loc) · 1.84 KB
/
studentdetails-count.get.hl
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
/*
* Template for HTTP GET CRUD requests.
* This file was automatically generated using Magic's CRUDifier.
*/
.arguments
operator:string
studentdetails._id.eq:long
studentdetails.stude_name.like:string
studentdetails.stude_name.eq:string
studentdetails.batch.like:string
studentdetails.batch.eq:string
studentdetails.admission_year.eq:date
studentdetails.email_id.like:string
studentdetails.email_id.eq:string
studentdetails.phone_no.like:string
studentdetails.phone_no.eq:string
studentdetails.linkedin.like:string
studentdetails.linkedin.eq:string
studentdetails.points.eq:long
.description:Counts items from your studentdetails table in your [generic|quiz_portal] database according to the specified arguments
.type:crud-count
// Verifying user is authorized to access endpoint.
auth.ticket.verify:root, admin
// Sanity checking invocation.
validators.enum:x:@.arguments/*/operator
.:or
.:and
/*
* Checking if user supplied an [operator] argument, and if so
* changing the boolean operator for comparison operations.
*/
if
exists:x:@.arguments/*/operator
.lambda
// User provided a boolean comparison [operator] argument.
set-name:x:../*/data.connect/*/data.read/*/where/*
get-value:x:@.arguments/*/operator
// Opening up our database connection.
data.connect:[generic|quiz_portal]
database-type:mysql
// Parametrising our read invocation.
add:x:./*/data.read
get-nodes:x:@.arguments/*/operator
remove-nodes:x:@.arguments/*/operator
add:x:+/*/where/*
get-nodes:x:@.arguments/*
// Reading data from database.
data.read
database-type:mysql
table:studentdetails
columns
count(*)
as:count
where
and
limit:long:1
// Returning result of above read invocation to caller.
return-nodes:x:@data.read/*/*