Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7884989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:56:47+00:00 2026-06-03T04:56:47+00:00

var couchdb = require(couchdb-api); var server = couchdb.srv(localhost, 5984, false, false); var db =

  • 0
var couchdb = require("couchdb-api");
var server = couchdb.srv(localhost, 5984, false, false);
var db = server.db("test");
var doc = db.doc("d5e1d042d579fcb1b3d4df07bc001f74");
doc.del(function (err, response) {
console.log(response);
console.log(err);
});

after that i am facing the problem,

null
{ error: 'bad_request', reason: 'Invalid rev format' }

but the corresponding document having the proper revision like 1-135dc47e3492a980fa45b3af9eb22a97 and proper data.

Please provide me the solution.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:56:48+00:00Added an answer on June 3, 2026 at 4:56 am

    I’m the creator of this module. The issue here is that you are attempting to delete the document without a revision number. (there is a _rev number on your document, but couchdb-api does not have that information) Any other attempt to write would also trigger this error under these conditions.

    You have a couple options as it stands now:

    Get the current document before attempting to write/delete

    doc.get(function (err, body) {
        doc.del(function (err, results) {
            // the delete will be successful
        });
    });
    

    Explicitly set your revision number before attempting the write/delete

    doc.body._rev = "1-myrevisionnumber";
    doc.del(...);
    

    I’m going to add a better error message here, and I’m considering adding a special flag that will tell couchdb-api to “force” a delete even if it doesn’t have the latest revision number. (ie. it will call get before del in order to avoid MVCC)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var htm = $.ajax({ type: GET, url: ./viewforms, async: false }).responseText; var myObject =
var thumbs = document.getElementsByTagName(img); for (var i=0; i<thumbs.length; i++) { Core.addEventListener(thumbs[i], click, function() {alert(i);});
var UI$Contract$ddlForm_change = function() { //'this' is currently the drop down that fires the
var A=function(){ }; $.extend(A.prototype, { init:function(){ alert('A init'); } }); var B=function(){ }; $.extend(B.prototype,A.prototype,{
Say that there is a couchdb session opened through nano on node.js var dbserv
var data = { message: Posting SWF using FB.api, display: 'iframe', caption: Caption Field,
var UsersMenu = function(){ this.returnUsers = []; this.retrieve = function(posts){ var temp = [];
var err = ''; err += 'err a'; myString = 'Blah'; new Ajax.Request('/check_me.php', {
var plugin = { Init: function() { this.UpdateUI(); if (this.Status() == 1) { ...
var MyObj = function(h,w){ this.height = h; this.width = w; } I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.