This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-23
Channels
- # aws-lambda (1)
- # bangalore-clj (13)
- # beginners (12)
- # boot (3)
- # cider (1)
- # cljs-dev (20)
- # clojure (208)
- # clojure-finland (1)
- # clojure-france (1)
- # clojure-russia (30)
- # clojure-serbia (12)
- # clojure-spec (7)
- # clojure-uk (14)
- # clojurescript (16)
- # cursive (6)
- # datomic (10)
- # emacs (1)
- # hoplon (4)
- # keechma (14)
- # leiningen (2)
- # off-topic (6)
- # om (43)
- # onyx (32)
- # pedestal (8)
- # perun (2)
- # re-frame (7)
- # reagent (33)
- # specter (5)
- # vim (4)
- # yada (9)
What kind of thing do you think should be in entitydb item meta-data? I know one example is a loading marker. So I suppose things that you wouldn't persist to the server?
@urbank yeah, I’m using meta to keep the information about the collection or named item, params that you used to load the collection, current status and stuff like that
With entity db, if I want to apply some function to each entity in a collection, should I reinsert the modified collection, or go by id and update the items?
Because with reinsertion, I think there's a problem with the thing that's there because of cyclical relations
If I do (insert-collection (f (get-collection))) and the entities in collection have a field that's a relation (therefore a function), I think there's an error
basically, there's an error if in (insert-collection entities), some fields of the entities are functions
So the error occurs when inserting an entity with a field that's marked as a relation in the schema, and that field is a function
Of course it's possible to call all the :author functions before reinserting, but that doesn't help if the relations are cyclical.
@urbank, yes that issue exists (when inserting the item that has assoctiations)
You can either remove the values that are functions from the entity map
or you can update with only the changed attrs - they will be merged by entitydb
so if you have entity that looks like this {:id 1, :name "foo"}
in the entitydb and you insert {:id 1, :lastname "bar"}
you will get the entity that looks like {:id 1 :name "foo" :lastname "bar"}
as a result