keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
urbank 2017-04-23T09:15:14.490932Z

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?

mihaelkonjevic 2017-04-23T10:31:47.621846Z

@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

urbank 2017-04-23T13:24:38.960927Z

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?

urbank 2017-04-23T13:25:22.962518Z

Because with reinsertion, I think there's a problem with the thing that's there because of cyclical relations

urbank 2017-04-23T13:28:02.968380Z

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

urbank 2017-04-23T13:29:00.970407Z

basically, there's an error if in (insert-collection entities), some fields of the entities are functions

urbank 2017-04-23T13:33:49.981316Z

hm... wait

urbank 2017-04-23T13:38:58.992750Z

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

urbank 2017-04-23T13:47:47.012770Z

Of course it's possible to call all the :author functions before reinserting, but that doesn't help if the relations are cyclical.

mihaelkonjevic 2017-04-23T16:37:52.470640Z

@urbank, yes that issue exists (when inserting the item that has assoctiations)

mihaelkonjevic 2017-04-23T16:38:49.473306Z

You can either remove the values that are functions from the entity map

mihaelkonjevic 2017-04-23T16:39:48.476097Z

or you can update with only the changed attrs - they will be merged by entitydb

mihaelkonjevic 2017-04-23T16:41:06.480167Z

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

urbank 2017-04-23T16:43:07.485841Z

Ah, that makes sense, thanks