anchor.diff:  
   insert( Topology, Coll, Doc ) when is_tuple(Doc); is_map(Doc) ->
   	{ ok, #{ pool := C } } = mc_topology:get_pool( Topology, [{rp_mode, primary}] ),
  -	mongo:insert( C, Coll, Doc ).
  +	try	mongo:insert( C, Coll, Doc ) of
  +		R -> R
  +	catch
  +	    error:not_master ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master };
  +		error:{bad_query,{not_master,_}}  ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master }
  +	end.
   
   
   update( Topology, Coll, Selector, Doc) ->
   	{ ok, #{ pool := C } } = mc_topology:get_pool( Topology, [{rp_mode, primary}] ),
  -	mongo:update( C, Coll, Selector, Doc ).
  +	try	mongo:update( C, Coll, Selector, Doc ) of
  +		R -> R
  +	catch
  +		error:not_master ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master };
  +		error:{bad_query,{not_master,_}}  ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master }
  +	end.
   
   
   
   
   delete(Topology, Coll, Selector) ->
   	{ ok, #{ pool := C } } = mc_topology:get_pool( Topology, [{rp_mode, primary}] ),
  -	mongo:delete( C, Coll, Selector ).
  +	try	mongo:delete( C, Coll, Selector ) of
  +		R -> R
  +	catch
  +		error:not_master ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master };
  +		error:{bad_query,{not_master,_}}  ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master }
  +	end.
  +
  +
   
   delete_one(Topology, Coll, Selector) ->
   	{ ok, #{ pool := C } } = mc_topology:get_pool( Topology, [{rp_mode, primary}] ),
  -	mongo:delete_one( C, Coll, Selector ).
  +	try	mongo:delete_one( C, Coll, Selector ) of
  +		R -> R
  +	catch
  +		error:not_master ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master };
  +		error:{bad_query,{not_master,_}}  ->
  +			mc_topology:update_topology( Topology ),
  +			{ error, not_master }
  +	end.
   
   
   
  
positive.code: 
  ensure_index( Topology, Coll, IndexSpec ) ->
  	{ ok, #{ pool := C } } = mc_topology:get_pool( Topology, [{rp_mode, primary}] ),
  	mc_connection_man:request_async(C, #ensure_index{collection = Coll, index_spec = IndexSpec}).
  
  
  
  
negative.code: -spec count(pid(), colldb(), selector()) -> integer().
  -spec count(pid(), colldb(), selector(), readprefs()) -> integer().
  -spec count(pid(), colldb(), selector(), readprefs(), integer()) -> integer().
  -spec ensure_index(pid(), colldb(), bson:document()) -> ok | { error, not_master }.
  -spec command(pid(), bson:document()) -> {boolean(), bson:document()} | { error, not_master }. % Action
  -spec command(pid(), bson:document(), readprefs()) -> {boolean(), bson:document()} | { error, not_master }. % Action
  
  
  % mongoc:connect( stat,
  