CipherStash
CipherStash Documentation

Delete record

You can delete a single record using the deleteRecord API.

import { Stash } from "@cipherstash/stashjs";

interface Movie {
  id?: string;
  title: string;
  runningTime: number;
  year: number;
}

const createAndDeleteMovie = async () => {
  const stash = await Stash.connect();
  const movies = await stash.loadCollection<Movie>("movies");

  const id = await movies.put({
    title: "CipherStash III",
    runningTime: 120,
    year: 2022,
  });

  // Delete the newly created CipherStash III movie
  await movies.delete(id);
};

createAndDeleteMovie();