Created
August 16, 2016 17:13
-
-
Save jdkealy/42bf630ceba6385914a43d5645d31d55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{:db/id #db/id [:db.part/user] | |
:db/ident :person/namer | |
:db/doc "ensures unique name" | |
:db/fn #db/fn {:lang "clojure" | |
:params [db oid name] | |
:code "(let [ e (datomic.api/q | |
'[:find ?e | |
:in $ ?oid ?name | |
:where | |
[?e :person/name ?name] | |
[?e :person/organization ?oid]] | |
db oid name )] | |
e | |
) | |
)" }}] | |
; returns {:db-before datomic.db.Db@65b31281, :db-after datomic.db.Db@b0f2cef1, :tx-data #object[java.util.ArrayList 0x66857a32 [datomic.db.Datum@195f0712]], :tempids {}} | |
; would like it to return the entity id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment