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
hm... wait
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
Ah, that makes sense, thanks