Now let's say I want to draw lines on a map for the traffic traveling between data centers. This means I need to know the "from_latitude", "from_longitude" for a traffic flow as well as the "to_latitude", "to_longitude"
Currently if I were to try and merge these, I might do something like the following:
This leads to a collision as the lat and lng columns are added to the traffic collection twice. Now I already have some semblance of a solution for this buried in the merge method. When a duplicate column name exists, _2 is appended (or _3, or _4,... I keep trying until I find a unique key)
So this means my final collection would look like so:
Another issue I recently ran into. Suppose I have the following two collections:
These get dumped from the database to CSV, then imported as JavaScript collections, then indexed:
Now let's say I want to draw lines on a map for the traffic traveling between data centers. This means I need to know the "from_latitude", "from_longitude" for a traffic flow as well as the "to_latitude", "to_longitude"
Currently if I were to try and merge these, I might do something like the following:
This leads to a collision as the
lat
andlng
columns are added to thetraffic
collection twice. Now I already have some semblance of a solution for this buried in themerge
method. When a duplicate column name exists,_2
is appended (or_3
, or_4
,... I keep trying until I find a unique key)So this means my final collection would look like so:
While this... works... it's not exactly pretty, nor easy to understand. It'd be better if I could rename the keys like so:
As this is a new feature and not a change to the existing API, this would bump the version to
0.1.1
or similar