LoginSignup
0
0

More than 3 years have passed since last update.

Deno: CouchDB のデータを削除 (Delete)

Posted at
couch_delete.ts
// ---------------------------------------------------------------
//  couch_delete.ts
//
//                  Jul/28/2020
//
// ---------------------------------------------------------------
import ky from 'https://deno.land/x/ky/index.js'
// ---------------------------------------------------------------
console.error ("*** 開始 ***")
const key_in:string = Deno.args[0]
console.log(key_in)

const url = "http://localhost:5984/nagano/" + key_in

const parsed = await ky.get(url).json()

console.log(parsed._rev)
console.log(parsed.name)

const url_del = url + '?rev=' + parsed._rev

const result = await ky.delete(url_del).json()

console.log(result)

console.error ("*** 終了 ***")
// ---------------------------------------------------------------

実行

deno run --allow-net couch_delete.ts t2027
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0