Fork me on GitHub

Is there some common terminology to distinguish between an entity map and an entity map with an :xt/id key? Some distinction to make it clear whether you're dealing with an db doc or plain map.. maybe just document vs. map?


an XT document is a map that (1) has a valid :xt/id (2) uses only keyword keys ("fields" / "attributes") and (3) is serializable with Nippy


> maybe just document vs. map :thumbsup:


Personally I tend to refer to them as entities, even though I probably mean 'the current document for this entity'.


Indeed, an entity is essentially just a timeline of documents correlated by a consistent :xt/id, but from the perspective of a concrete "as-of" db value (a.k.a. "snapshot" / "timeslice") we generally stick to using the term "entity" (e.g. when discussing q, pull, or entity API calls). The other way to frame it is that documents are physical, whereas entities are conceptual.


The reason I ask is because I want to put some instrumentation in my DB layer and therefore need a spec for both a) an entity map with all the fields to describe it and b) that same entity, but ready to be inserted to the DB or has been retrieved from it (i.e. has :xt/id). So, need a name for each. And there should be many such pairs, so a consistent naming scheme should help..

👍 2

Sounds like entity vs. map or doc are reasonable choices. Thanks for the input!

🙏 1