3 ms·
The language reminds me of xquery: Morel: from e in hr.emps, d in depts where e.deptno = d.deptno yield {e.id, e.deptno, ename = e.name, d
by fxj 7y ago
The language reminds me of xquery:
Morel:
from e in hr.emps,
d in depts
where e.deptno = d.deptno
yield {e.id, e.deptno, ename = e.name, dname = d.name};
Xquery:
for $act in doc("hamlet.xml")//ACT
let $speakers := distinct-values($act//SPEAKER)
return
<div><h1>{ string($act/TITLE) }</h1></div>
and other LINQ like languages:
var results = from c in SomeCollection
where c.SomeProperty < 10
select new {c.SomeProperty, c.OtherProperty};
or JSONiq:
for $p in collection("persons")
where $p.age gt 20
let $home := $p.phoneNumber[][$$.type eq "home"].number
group by $area := substring-before($home, " ")
return {"area code" : $area, "count" : count($p)}