datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
val_waeselynck 2020-09-11T00:44:39.391900Z

Whait, copying Datomic dbs is no longer O(1) ? What a pity :)

nando 2020-09-11T22:40:44.395700Z

If an attribute has a :db.cardinality/many, can it have other value types besides :db.type/ref? If so, what does a query or pull of that attribute return? A vector? A set? And what does a transaction expect if multiple values are passed into an attribute with a cardinality of many?

nando 2020-09-11T22:42:26.396800Z

I'm so used to relational databases, I'm not sure what mental model I should have here.

favila 2020-09-11T22:48:04.397800Z

Cardinality many means you are allowed more than one assertion datom per e+a at a time

favila 2020-09-11T22:48:20.398300Z

They’re still separate assertions

favila 2020-09-11T22:49:10.399500Z

So in query there is no difference

favila 2020-09-11T22:49:56.400600Z

In pull results, they are vectors of values, but they will be unique

favila 2020-09-11T22:50:13.401100Z

And any type can be cardinality many

nando 2020-09-11T22:51:27.401900Z

So I cannot transact several values in an array, for instance. They should be in separate maps?

favila 2020-09-11T22:52:26.402800Z

You can have more than one db/assert

favila 2020-09-11T22:53:00.403800Z

And a map with a set value will desugar to multiple assertions

favila 2020-09-11T22:53:38.405100Z

I want to emphasize that each value is from separate datom. It’s not that you have a datom with many values in it

nando 2020-09-11T22:53:56.405800Z

Oh, good. I'm working with a web app.

favila 2020-09-11T22:54:02.406200Z

The vector you get from pulls, and the transaction map form are projections

nando 2020-09-11T22:54:19.406400Z

Understand they are separate datoms, good.

nando 2020-09-11T22:55:50.406600Z

Ok, so I'll work it out through experimentation from here. Thanks for the pointers!