Let's say I have a datomic data that looks like this -
Author (id: 5) {
name: "Mercy",
blogs: [1, 2]
}
Blog (id: 1) {
title: "Hello blog"
}
Blog (id: 2) {
title: "Hello blog second"
}
I want to find a author by name and all the title of their blogs and count of blogs. So far, I have
[:find ?blogs ?c
:where
[?e :name "Mercy"]
[?e :blogs ?blogs]
[(count ?blogs) ?c]
]
I was only able to get the total count of blogs. How can I get the title of the blogs using just datalog queries? I also cannot have belongs_to relationship on the blog entity.
Update
'author/blogs' has schema that looks like:
{
:db/ident :blog
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many
}