anchor.diff:          {connection_failure, Reason} -> {error, Reason}
       end.
   
  -push(_Conn, _Depth) ->
  -    ok.
  -
  -pop(_Conn, _Depth) ->
  -    ok.
  -
  -dump(_Conn) -> "".
  +% These 2 functions are not part of the behaviour but are required for
  +% tests to pass
  +push(_Conn, _Depth) -> ok.
  +
  +pop(_Conn, _Depth) -> ok.
   
   %%
   %% Internal functions
  
positive.code: -behaviour(boss_db_adapter).
  -export([start/0, start/1, stop/1, find/2, find/7]).
  -export([count/3, counter/2, incr/2, incr/3, delete/2, save_record/2]).
  -export([push/2, pop/2, dump/1, execute/2]).
  
  -define(LOG(Name, Value), io:format("DEBUG: ~s: ~p~n", [Name, Value])).
  
  
negative.code:     [_, MongoId] = string:tokens(BossId, "-"),
      {hex2dec(MongoId)}.
  
  attr_value(id, MongoDoc) ->
      proplists:get_value('_id', MongoDoc);
  attr_value(AttrName, MongoDoc) ->
      proplists:get_value(AttrName, MongoDoc).
  
  mongo_to_boss_value(id, Value, RecordType) ->
      mongo_to_boss_id(RecordType, Value);
  mongo_to_boss_value(AttrName, {_,_,_} = Value, _) ->
      case lists:suffix("_time", atom_to_list(AttrName)) of
          true -> calendar:now_to_datetime(Value);
          false -> Value
      end;
  mongo_to_boss_value(_, Value, _) ->
      Value.
  
  attribute_names(Type) ->
      DummyRecord = apply(Type, new, lists:seq(1, proplists:get_value(new, Type:module_info(exports)))),
      DummyRecord:attribute_names().
  
  mongo_tuple_to_record(Type, Row) ->
      MongoDoc = tuple_to_proplist(Row),
      Args = lists:map(fun(AttrName) ->
                  MongoValue = attr_value(AttrName, MongoDoc),
                  mongo_to_boss_value(AttrName, MongoValue, Type)
          end, attribute_names(Type)),
      apply(Type, new, Args).
  
  infer_type_from_id(Id) when is_list(Id) ->
  