anchor.diff:    Id.
   
   
  +seconds_to_timestamp(Seconds) ->
  +  {timestamp, bson:secs_to_unixtime(Seconds)};
  +seconds_to_timestamp(_) ->
  +  {timestamp, {0, 0, 0}}.
  +
  +timestamp_to_seconds({timestamp, Timestamp}) ->
  +  bson:unixtime_to_secs(Timestamp);
  +timestamp_to_seconds(_) ->
  +  0.
  +
   %%test() ->
   %%em_storage_mongo:create_device(#device{name = <<"auto5">>, uniqueId =  <<"005">>}).
   %%em_storage_mongo:update_device(#device{id = 1471064827, status = <<"online">>}).
  
positive.code:        <<"name">> => Rec#device.name,
         <<"uniqueId">> => Rec#device.uniqueId,
         <<"status">> => Rec#device.status,
         <<"lastUpdate">> => Rec#device.lastUpdate,
         <<"positionId">> => Rec#device.positionId
       };
  to_map(position, Rec) ->
  
negative.code:        <<"_id">> => id_to_objectid(Rec#position.id),
         <<"type">> => Rec#position.type,
         <<"protocol">> => Rec#position.protocol,
         <<"serverTime">> => seconds_to_timestamp(Rec#position.serverTime),
         <<"deviceTime">> => seconds_to_timestamp(Rec#position.deviceTime),
         <<"fixTime">> => seconds_to_timestamp(Rec#position.fixTime),
         <<"deviceId">> => id_to_objectid(Rec#position.deviceId),
         <<"outdated">> => Rec#position.outdated,
         <<"valid">> => Rec#position.valid,
         <<"latitude">> => Rec#position.latitude,
  