LightningDB.LightningTransaction.Delete C# (CSharp) Method

Delete() public method

Delete items from a database. This function removes key/data pairs from the database. If the database does not support sorted duplicate data items (MDB_DUPSORT) the data parameter is ignored. If the database supports sorted duplicates and the data parameter is NULL, all of the duplicate data items for the key will be deleted. Otherwise, if the data parameter is non-NULL only the matching data item will be deleted. This function will return MDB_NOTFOUND if the specified key/data pair is not in the database.
public Delete ( LightningDatabase db, byte key ) : void
db LightningDatabase A database handle returned by mdb_dbi_open()
key byte The key to delete from the database
return void
        public void Delete(LightningDatabase db, byte[] key)
        {
            mdb_del(_handle, db.Handle(), key);
        }

Same methods

LightningTransaction::Delete ( LightningDatabase db, byte key, byte value ) : void

Usage Example

        public static void Delete <TKey, TValue>(this LightningTransaction txn, LightningDatabase db, TKey key, TValue value)
        {
            var keyBytes   = db.ToBytes(key);
            var valueBytes = db.ToBytes(value);

            txn.Delete(db, keyBytes, valueBytes);
        }
All Usage Examples Of LightningDB.LightningTransaction::Delete