Filter Out Prior Versions

The reason that the app is displaying all versions of a post title is that we did not filter out the prior versions. We can do that with an existential condition notExists. We only want the PostTitle facts that are not the prior of another PostTitle.

const postsInSite = model.given(Site).match((site, facts) =>
    .join(post =>, site)
    .select(post => ({
      hash: j.hash(post),
      titles: facts.ofType(PostTitle)
        .join(title =>, post)
        .notExists(title => facts.ofType(PostTitle)
          .join(next => next.prior, title)
        .select(title => title.value)

Take a look at the app now. You should see only the latest version of the post title.

Latest version of each post title

That's how you'll build an app using Jinaga. Build something awesome!

Continue With


Jinaga is a product of Jinaga LLC.

Michael L Perry, President