Fork me on GitHub
#datomic
<
2016-01-28
>
jimmy07:01:59

hi guys, in my entity I have :project/started-date and its type is instant. Is there anyway that I can get all the projects that is within a date range using datomic rule ? Or it's better get the data out of datomic then do the filter on it ?

Lambda/Sierra13:01:03

@nxqd: You can use a regular Datomic query with < and > predicate constraints on the value of :project/started-date

jimmy13:01:19

@stuartsierra: thanks. It seems I overthought the solution then simple_smile

bplatz18:01:22

Hi, I'm trying to convert a #datom into just a vector, basically doing some post-processing on this data before sending it out to subscribed clients.

bplatz18:01:50

Is there an easy and performant way to do this in clojure? Right now the way I do it seems like it would be inefficient.

bplatz18:01:59

I'm using: (juxt :e :a :v :tx :added)

bplatz21:01:05

Pretty sure that throws... I'll try to make sure.

Lambda/Sierra21:01:25

Ah, maybe (vec (seq datom)) or something similar.

bplatz21:01:10

seq throws: CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: datomic.db.Datum,

bplatz21:01:32

vec throws: CompilerException java.lang.RuntimeException: Unable to convert: class datomic.db.Datum to Object[],

Lambda/Sierra21:01:44

ah, then maybe juxt is the way to go

Lambda/Sierra21:01:47

If you need a vector.

Lambda/Sierra21:01:53

or destructure like (let [[e a v tx add] datom] [e a v tx add])