Fork me on GitHub
Shuky Badeer17:03:29

Heyy guys! general question, suppose we have a movie "row" in datomic, we change it's name at some point, then we query that movie to get its details, does datomic return the latest version of it or ALL versions? Can we tell datalog whether to send all versions or not? Thanks a lot!


Most commonly you’ll be working with the latest version of an entity. If you specify an older state of the database (often done via a timestamp), then you can see the entity as it was. Alternately you can query the history of changes to attributes and assemble your own notion of the versions.

Shuky Badeer09:03:13

@U0CV48L87 thank you! So, by default, a query in datomic returns the latest version of the datom? Right now i seem to be getting all versions of it so i wonder if i'm doing something wrong in adding datoms or whether i should adjust the query code

Jarrod Taylor (Clojure team)14:03:50

If you want to provide a link to example code demonstrating your efforts we can help you understand the responses you are seeing.


Yeah, I think it's easiest to look at an example @U033V0AJFU4 so feel free to share. But in Datomic you pass a DB value to the query. You will get results in query from the DB value you are passing, in Datomic a is a set of datoms. A point-in-time immutable value that will never change. If you want to see all history we have the also: This is true for both on-prem and Cloud.