Fork me on GitHub

@jdkida you can use the pull API directly (onprem)


ahh, i see. eid or (unique-id) work?


or lookup ref


it takes an entity identfier


Hi all, newbie question: does Datomic support "ordered" :db/cardinality many attributes? I'd like to store a vector of values, and somehow retrieve the same, ordered vector. The actual use case would be an entity that refers to other entities, but those references do have a defined order. I can't seem to find a way to do this on the data model/schema level. Is this an application/client concern rather, meaning I store data required to reconstruct the order and reorder after retrieval?


Check out Datofu, it has helpers for that IIRC

Braden Shepherdson17:11:51

well, the underlying indexes are always sorted, but that order doesn't necessarily survive in a query.

Braden Shepherdson17:11:51

generally you have to do your own sorting in memory. if there's some arbitrary order (say, tracks on an album) then you need to record those as attributes.

Braden Shepherdson17:11:32

putting it slightly differently, you might transact {:foo/id (uuid "...") :foo/things [19 12 22]} but that's just a shorthand. it swiftly gets unpacked to a set of entity-attribute-value triples, and the order of your vector is lost. it's just a set to Datomic.


Thanks @braden.shepherdson, that's what I suspected - this is an application level concern then.


If you need control over partially-fetching items in a certain order, use d/index-pull

👍 3