ONgDB Fabric| ONgDB-v1.0 Fabric组件
Fabric查询功能v1.0,Neo4j Fabric功能在ONgDB-v1.0中的同类实现。
//Neo4j
USE example.graphA
MATCH (movie:Movie)
RETURN movie.title AS title
//ONgDB
CALL c1(
'MATCH (movie:Movie) RETURN movie.title AS title'
) YIELD value
RETURN value.title AS title
//Neo4j
USE example.graphA
MATCH (movie:Movie)
RETURN movie.title AS title
UNION
USE example.graphB
MATCH (movie:Movie)
RETURN movie.title AS title
//ONgDB
CALL c1(
'MATCH (movie:Movie) RETURN movie.title AS title'
) YIELD value
RETURN value.title AS title
UNION
CALL c2(
'MATCH (movie:Movie) RETURN movie.title AS title'
) YIELD value
RETURN value.title AS title
//Neo4j
UNWIND example.graphIds() AS graphId
CALL {
USE example.graph(graphId)
MATCH (movie:Movie)
RETURN movie.title AS title
}
RETURN title
//ONgDB
UNWIND c.ids() AS cId
CALL c(
cId,
'MATCH (movie:Movie) RETURN movie.title AS title'
) YIELD value
RETURN value.title AS title
//Neo4j
UNWIND example.graphIds() AS graphId
CALL {
USE example.graph(graphId)
MATCH (movie:Movie)
RETURN movie.released AS released
}
RETURN min(released) AS earliest
//ONgDB
UNWIND c.ids() AS cId
CALL c(
cId,
'MATCH (movie:Movie) RETURN movie.released AS released'
) YIELD value
RETURN min(value.released) AS earliest
//Neo4j
CALL {
USE example.graphA
MATCH (movie:Movie)
RETURN max(movie.released) AS usLatest
}
CALL {
USE example.graphB
WITH usLatest
MATCH (movie:Movie)
WHERE movie.released = usLatest
RETURN movie
}
RETURN movie
//ONgDB
CALL c1(
'MATCH (movie:Movie) RETURN max(movie.released) AS usLatest'
) YIELD value
WITH value.usLatest AS usLatest
CALL c2(
'MATCH (movie:Movie) WHERE movie.released=$usLatest RETURN movie',
{usLatest:usLatest}
) YIELD value
RETURN value.movie AS movie