Closed scttnlsn closed 9 years ago
Underscores sure are a problem. When you write [:db/add X :test/_bar Y] it reads backwards, meaning “put a reference from Y to X via :test/bar property”. So it expects both X and Y to be integers. In your case, you put hashmap at Y pos, and that wouldn’t work as an entity id.
So two problems for me to fix here:
Error should be thrown in second case (you don’t get it here by pure luck):
(d/transact! conn [{:db/id -1 :test/_bar {:baz "qux"}}])
@tonsky Okay, thanks. I'll have to read the Datomic docs about this. I don't get any error when there's only a single attribute (like no. 2 above).
datomic allows to specify maps when creating nested relation, but ds does not support this feature yet. what about backward relation, I'm no sure that even datomic supports that=
I'm getting this error occasionally when calling
transact!
. The only pattern I could find possibly has something to do with the underscores in the following example...This always throws an error:
But these always work fine:
Here's the JavaScript stack trace:
Any ideas?