We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
Use the has
function to get some sample nodes.
Use expand(_all_)
to expand the nodes’ edges, then assign them to a variable.
The variable can now be used to iterate over the unique neighboring nodes. Then
use count(uid)
to count the number of nodes in a block.
Use the has
function among the value variables to search on non-indexed
predicates.
Dgraph sorting is based on a single level of the subgraph. To sort a level by the values of a deeper level, use query variables to bring nested values up to the level of the edge to be sorted.
Example: get all actors from a Steven Spielberg movie sorted alphabetically. The
actor’s name isn’t accessed from a single traversal from the starring
edge.
The name is accessible via performance.actor
.
To obtain unique results, assign the node’s edge to a variable. The variable can now be used to iterate over the unique nodes.
Example: get all unique genres from all of the movies directed by Steven Spielberg.
checkpwd
booleanStore the result of checkpwd
in a query variable and then match it against 1
(checkpwd
is true
) or 0
(checkpwd
is false
).
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
Use the has
function to get some sample nodes.
Use expand(_all_)
to expand the nodes’ edges, then assign them to a variable.
The variable can now be used to iterate over the unique neighboring nodes. Then
use count(uid)
to count the number of nodes in a block.
Use the has
function among the value variables to search on non-indexed
predicates.
Dgraph sorting is based on a single level of the subgraph. To sort a level by the values of a deeper level, use query variables to bring nested values up to the level of the edge to be sorted.
Example: get all actors from a Steven Spielberg movie sorted alphabetically. The
actor’s name isn’t accessed from a single traversal from the starring
edge.
The name is accessible via performance.actor
.
To obtain unique results, assign the node’s edge to a variable. The variable can now be used to iterate over the unique nodes.
Example: get all unique genres from all of the movies directed by Steven Spielberg.
checkpwd
booleanStore the result of checkpwd
in a query variable and then match it against 1
(checkpwd
is true
) or 0
(checkpwd
is false
).