(do
(def a {:foo :bar})
(def b {:another :value :foo :BAR})
(merge-with (fn [x y]
(conj (if-not (vector? x)
[x]
x)
y))
a b))
If override the duplicate values merge could be used. Also one
Sorry, this is the problem with working all night. My sleep deprived eyes
skipped over this line:
old-field-value (get old-documents field-name [])
I fetch the value from the wrong map. Such a basic error.
On Wednesday, October 11, 2017 at 1:44:13 PM UTC-4,
I should remove the parens before they confuse anyone. They are added by
the log statement. Without the parens:
{:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]}
field-name:
:company_profile_id
field-value:
["2"]
but I in the final document I only get:
"final
So I tried this:
new-field-value (into [] (concat old-field-value
field-value))
And I did not get what I expected. Maybe I am sleep deprived, but I don't
see why I can't build up a vector with several values. This is in a map in
an atom. This is the code:
(swap!
So I have this:
({:company_profile_id ["2"], :topic :company, :url ["mikeshawauto.com"]})
And then I get this field name and value:
(:company_profile_id)
(["2"])
The next 3 lines of code are:
old-field-value (get old-documents field-name [])
Using conj instead of into, for no particular reason, except debugging. The
document is slowly built-up:
({:company_profile_id [["2"]], :topic :company, :url
[["mikeshawauto.com"]]})
({:company_profile_id [["2"]], :topic :company, :url
[["mikeshawauto.com"]]})
({:company_profile_id [["2"]],
Nevermind. Something about my reasoning is off on this one. I notice that
even if I use conj, the same problem happens, I get 4 values in 4 vectors
instead of 5 values in 4 vectors. So there must be some earlier step that
I've gotten wrong.
On Wednesday, October 11, 2017 at 11:44:40 AM
I seem unable to figure out where I made a mistake, though this should be
simple.
I have two SQL calls that bring back 5 fields:
SELECT company_profile_id , reference_id, reference_source FROM
company_reference_idlimit 1 ;
++--+--+
|