anchor.diff:    lists:zip([component, version, cores, jobs, uuid, ukn], strings:tokens(User, "_")).
   
   %@doc Creates a MonoDB document describing the connection
  -doc_create_connection({User, Host, Resource} = JID, IPAddress) ->
  +doc_create_connection({User, Host, Resource}, IPAddress) ->
     GeoData = lookup_ip(IPAddress),
  -  X = proplists:get_value(longitude, GeoData),
  -  Y = proplists:get_value(latitude, GeoData),
  +  Lng = proplists:get_value(longitude, GeoData),
  +  Lat = proplists:get_value(latitude, GeoData),
   
     {jid, User ++ "@" ++ Host ++ "/" ++ Resource,
  -   loc, [X, Y],
  -   active, true}
  +   loc, [Lng, Lat],
  +   connected_at, bson:timenow(),
  +   connected, true}.
   
   %@doc Marks connection as closed and appends data from agent's JID
   doc_close_connection({ok, {}}, JID, IPAddress) ->
  
positive.code:   Opts = proplists:get_value(opts, State),
    Host = case proplists:get_value(mongodb, Opts) of
      undefined -> {localhost, 27017};
      Value -> Value;
    end,
    {ok, NewConn} = mongo:connect(Host),
    proplists:delete(conn, State) ++ [{conn, NewConn}].
  
negative.code: mongo_do(State, Table, Op) ->
    Conn = proplists:get_value(mongo, State),
    case mongo:do(safe, master, Conn, Table, Op) of
      {ok, _} -> {noreply, State};
      {failure, Failure} ->
        ?DEBUG("MongoDB operation failed with: ~p", [Failure]),
        {noreply, mongo_reconnect(State)}
  