For inner joins, you can use clojure.set/join
:
(clojure.set/join v1 v2 {:name :title})
You're sample result seems to indicate that you want to perform a left join, however. If so, you may want to look into some existing Stack Overflow questions on outer joins in Clojure; for example, my answer to the recent Full outer join two sequences of maps in Clojure question provides a performant solution to the full outer join problem, which could straightforwardly be adapted to produce left joins instead.
Here's one possible adaptation:
(defn left-join [key-map xs ys]
(let [kes (seq key-map)
lks (mapv key kes)
rks (mapv val kes)
gxs (group-by #(mapv (fn [k] (get % k)) lks) xs)
gys (dissoc (group-by #(mapv (fn [v] (get % v)) rks) ys) nil)
kvs (keys gxs)]
(persistent!
(reduce (fn [out kv]
(let [l (get gxs kv)
r (get gys kv)]
(if (seq r)
(reduce (fn [out m1]
(reduce (fn [out m2]
(conj! out (merge m1 m2)))
out
r))
out
l)
(reduce conj! out l))))
(transient [])
kvs))))
At the REPL:
(left-join {:name :title} v1 v2)
;= [{:name "name1", :datofBirth "1-1-1971", :title "name1",
:address "address1"}
{:name "name2", :address "address2"}]
If you'd rather dissoc
:title
from the resulting maps and add the missing keys to the records from the left side for which there are no corresponding records on the right side, you could modify the function slightly or just do it in a postprocessing step.