tonsky/datascript — pull request #16 by lynaghk (2014-08-26 04:16:24+00:00)
Title: Unroll :db.cardinality/many assertions

With the latest (0.3.0) DataScript, `:db.cardinality/many` attributes are returned differently than they are in Datomic.

In DataScript:

```clojure
(let [schema {:children {:db/cardinality :db.cardinality/many}}
conn (d/create-conn schema)]

(d/transact! conn [{:db/id -1 :children #{"A" "B"}}])

(->> (d/q '[:find ?e :where [?e :children _]]
@conn)
ffirst
(d/entity @conn)
:children)) ;;=> #{#{"B" "A"}}
```

whereas in Datomic the same code returns `#{"B" "A"}`.
Changing the transaction data to:

```clojure
(d/transact! conn [{:db/id -1 :children "A"}
{:db/id -1 :children "B"}])
```

returns `#{"A" "B"}`.

If this is the desired behavior, would you be open to a pull request that makes

```clojure
(d/transact! conn [{:db/id -1 :children #{"A" "B"}}])
```

equivalent to

```clojure
(d/transact! conn [{:db/id -1 :children "A"}
{:db/id -1 :children "B"}])
```