Datomic has recently been updated with several expression functions available to you in Datomic queries. One of these functions is called get-else , and it allows you to provide a default return value if the attribute does not exist in nature, just as clojure.core/get returns setting the third parameter, if the key is not found.
Thus, using your own example, you will need to modify it like this:
[:find ?n ?a ?l :where [?n :age ?a] [(get-else $ ?n :likes false) ?l]
Unfortunately, you cannot actually make nil default value, since it is not a valid Datomic data type, and Datomic will work if you try, but false should get you where you are going too.
source share