PageRenderTime 31ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/50/70.md

http://github.com/osinka/subset
Markdown | 18 lines | 13 code | 5 blank | 0 comment | 0 complexity | e457ffa1fc133ec2eb15578457b9bf63 MD5 | raw file
 1# Field Alias
 2
 3Sometimes a subset's field can be used so frequently, that it makes
 4sense to create a field alias. The idea is to avoid repetiting code
 5like
 6
 7```scala
 8val query = subset.where{_.field === 10}
 9```
10
11and instead write
12
13```scala
14val alias = field.in(subset)
15val query = alias === 10
16```
17
18* * *