code: func (ds *datastore) DeleteObjectAtomic(kvObject KVObject) error {
  	if ds.sequential {
  		ds.Lock()
  		defer ds.Unlock()
  	}
  
  	if kvObject == nil {
  		return types.BadRequestErrorf("invalid KV Object : nil")
  	}
  
  	previous := &store.KVPair{Key: Key(kvObject.Key()...), LastIndex: kvObject.Index()}
  
  	if kvObject.Skip() {
  		goto del_cache
  	}
  
  	if _, err := ds.store.AtomicDelete(Key(kvObject.Key()...), previous); err != nil {
  		if err == store.ErrKeyExists {
  			return ErrKeyModified
  		}
  		return err
  	}
  
  del_cache:
  	// cleanup the cache only if AtomicDelete went through successfully
  	if ds.cache != nil {
  		// If persistent store is skipped, sequencing needs to
  		// happen in cache.
  		return ds.cache.del(kvObject, kvObject.Skip())
  	}
  
  	return nil
  }
docs: // DeleteObjectAtomic performs atomic delete on a record