Skip to content

Instantly share code, notes, and snippets.

@viebel
Created June 28, 2019 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viebel/2aa5135e80a995b002dd279e972c530b to your computer and use it in GitHub Desktop.
Save viebel/2aa5135e80a995b002dd279e972c530b to your computer and use it in GitHub Desktop.
(require '[datascript.core :as d])
(let [schema {:aka {:db/cardinality :db.cardinality/many}}
conn (d/create-conn schema)]
(d/transact! conn [ { :db/id -1
:name "Maksim"
:age 45
:aka ["Max Otto von Stierlitz", "Jack Ryan"] } ])
(d/q '[ :find ?n ?a
:where [?e :aka "Max Otto von Stierlitz"]
[?e :name ?n]
[?e :age ?a] ]
@conn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment