FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
NRedisStack/src/NRedisStack/Search/Group.cs at master · redis/NRedisStack · GitHub
redis
NRedisStack
Repository navigation
Code
Issues
Pull requests
6
(6)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
NRedisStack
/
src
/
NRedisStack
/
Search
/
Group.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (38 loc) · 1.07 KB
Breadcrumbs
NRedisStack
/
src
/
NRedisStack
/
Search
/
Group.cs
Copy path
File metadata and controls
44 lines (38 loc) · 1.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
namespace
NRedisStack
.
Search
.
Aggregation
;
public
class
Group
{
private
readonly
IList
<
Reducer
>
_reducers
=
new
List
<
Reducer
>
(
)
;
private
readonly
IList
<
string
>
_fields
;
private
Limit
_limit
=
Aggregation
.
Limit
.
NO_LIMIT
;
public
Group
(
params
string
[
]
fields
)
=>
_fields
=
fields
;
public
Group
(
IList
<
string
>
fields
)
=>
_fields
=
fields
;
internal
Group
Limit
(
Limit
limit
)
{
_limit
=
limit
;
return
this
;
}
internal
Group
Reduce
(
Reducer
r
)
{
_reducers
.
Add
(
r
)
;
return
this
;
}
internal
void
SerializeRedisArgs
(
List
<
object
>
args
)
{
args
.
Add
(
_fields
.
Count
)
;
foreach
(
var
field
in
_fields
)
args
.
Add
(
field
)
;
foreach
(
var
r
in
_reducers
)
{
args
.
Add
(
"REDUCE"
)
;
args
.
Add
(
r
.
Name
)
;
r
.
SerializeRedisArgs
(
args
)
;
var
alias
=
r
.
Alias
;
if
(
!
string
.
IsNullOrEmpty
(
alias
)
)
{
args
.
Add
(
"AS"
)
;
args
.
Add
(
alias
!
)
;
}
}
_limit
.
SerializeRedisArgs
(
args
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL