Fork me on GitHub
#datomic
<
2016-01-04
>
darrellesh22:01:51

Having a hard time with the built-in database function db.fn/cas when trying to set a ref many field. Is it possible to perform a compare and set for a REF MANY field. If so, any help would be appreciated. As a sidenote, I am trying to transact in Clojure.

domkm23:01:45

@darrellesh: As far as I know, :db.fn/cas does not work for any cardinality many attribute types or even for cardinality one refs if the ids passed are idents or lookup refs. In my experience it's only really good for cardinality one non-ref attributes.

darrellesh23:01:12

@domkm: Yeah. That is what I was seeing in my repl tests. Is there any documentation around this function as to how it should be used. The Datomic transaction function docs do not mention any limitations. Thanks in advance...

domkm23:01:14

@darrellesh: I'm not familiar with official docs on it's limitations. I recall seeing some unofficial statements in the Datomic Google Group but I wouldn't be able to point you to the exact post.

darrellesh23:01:41

@domkm: Good to know. Not what I was hoping for - but thanks for your help. There should be some Docs on this! But, then again we are not talking about SQL databases.

darrellesh23:01:28

@domkm: Wow! that is exactly what we are looking for at first glance.