Fork me on GitHub
#datomic
<
2018-02-19
>
steveb8n06:02:36

Is “filter” likely to be supported by the Cloud/Client API in future? It’s not there now but, because as-of is already supported, it seems like using custom filters might be possible/in the works. This is really valuable for building a multi-tenant web service so I suspect I’m not the only one interested in this.

sleepyfox16:02:40

Question: I've looked through the doco but I can't find anything clear on this. I have two entities, let's call them order and order-item. I want to create an order, which will have two order items. I will transact both order items, then transact the order, which will include two references to the two order-items. I have created a :db.type/ref entry with a cardinality of many in order to hold these references to order-items. How do I actually get the refs from transacting the order-items so to 'insert' them into the order transaction?

sleepyfox16:02:02

It's plain that I'm missing something obvious, but I can't quite see what.

stuarthalloway16:02:18

but I would back up and ask “how can an order line item exist without an order”?

stuarthalloway16:02:40

aren’t they “cart items” or “potential order items” or something at that moment in time?

sleepyfox16:02:17

Can I add them at the same time then? If so, how?

sleepyfox16:02:49

I assume that there must be some sort of equivalent of a foreign key reference, but the doco is rather light on examples

stuarthalloway16:02:54

@sleepyfox have you seen the tutorials repo? This stories/comments example is fairly similar to orders/items https://github.com/cognitect-labs/day-of-datomic-cloud/blob/master/tutorial/component_attributes.clj

sleepyfox16:02:24

Thanks, I'll take a look.

cjsauer17:02:34

Hey all, quick question: part of my client's requirement is to "reset their account information", meaning clear all fields. If I remember correctly, I wasn't able to transact an empty map as an entity into datomic...what would be the recommended way to accomplish something like this?

joelsanchez17:02:52

retract the datoms: [:db/retract entity-id ident val-to-retract]

cjsauer17:02:53

I was considering potentially transacting something like { :user/reset (Date.) } to capture that event as data as their new profile

cjsauer17:02:48

@joelsanchez thaaat makes more sense. Thanks 🙂

cjsauer17:02:16

Still getting used to the datomic information model