I have this dictionary on nsparce tables.
general_ledger=Dict(
#:description => ndsparse(date=date, memo=memo),
:dividends => ndsparse((debit=x,
credit=y),
(balance=z,)),
:expenses => ndsparse((debit=x,
credit=y),
(balance=z,)),
:assets => ndsparse((debit=x,
credit=y),
(balance=z,)),
:liablities => ndsparse((debit=x,
credit=y),
(balance=z,)),
:equity => ndsparse((debit=x,
credit=y),
(balance=z,)),
:revenue => ndsparse((debit=x,
credit=y),
(balance=z,))
)
and I want to add a new row
default_values=Dict(
"dividends"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)),
"expenses"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)),
"assets"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)),
"libilites"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)),
"equity"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)),
"revenue"=>ndsparse((
debit=[0],
credit=[0]),
(balance=[0],)))
spec = Dict(
credit_account =>ndsparse((
debit=[0],
credit=[credit_amount]),
(balance=[0],)),
debit_account => ndsparse((
debit=[debit_amount],
credit=[0]),
(balance=[0],)))
modified! = merge!(default_values, spec)
merge(general_ledger, modified!)
instead of adding a row to each nsparse table, it creates new entries.