Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. FOR n in 0..100000
  2. INSERT {_key: TO_STRING(n), val: n, modulo: n%2} INTO vertex
  3. FILTER n > 0
  4. INSERT {_from: CONCAT("vertex/", FLOOR((n-1)/2)), _to: NEW._id} INTO edge
  5.  
  6. WITH vertex
  7. FOR v,e,p IN 0..5 OUTBOUND "vertex/0" edge
  8. RETURN TO_STRING(p.vertices[*].val)
  9.  
  10. [
  11. "[0]",
  12. "[0,1]",
  13. "[0,1,3]",
  14. "[0,1,3,7]",
  15. "[0,1,3,7,15]",
  16. "[0,1,3,7,15,31]",
  17. "[0,1,3,7,15,32]",
  18. "[0,1,3,7,16]",
  19. "[0,1,3,7,16,33]",
  20. "[0,1,3,7,16,34]",
  21. "[0,1,3,8]",
  22. "[0,1,3,8,17]",
  23. "[0,1,3,8,17,35]",
  24. "[0,1,3,8,17,36]",
  25. "[0,1,3,8,18]",
  26. "[0,1,3,8,18,37]",
  27. "[0,1,3,8,18,38]",
  28. "[0,1,4]",
  29. ...
  30.  
  31. WITH vertex
  32. FOR v,e,p IN 0..5 OUTBOUND "vertex/0" edge
  33. PRUNE v.hide == 1 AND v.stop == true
  34. RETURN TO_STRING(p.vertices[*].val)
  35.  
  36. [
  37. "[0]",
  38. "[0,1]",
  39. "[0,1,3]",
  40. "[0,1,3,7]", <-- stop: true, hide: 1
  41. "[0,1,3,8]",
  42. "[0,1,3,8,17]", <-- stop: true, hide: 1
  43. "[0,1,3,8,18]",
  44. "[0,1,3,8,18,37]",
  45. "[0,1,3,8,18,38]",
  46. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement