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 6602945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:56:26+00:00 2026-05-25T18:56:26+00:00

I’m new to Couchdb just a few week back I git clone the couchdb

  • 0

I’m new to Couchdb just a few week back I git clone the couchdb app called sofa [what and app] . Over the week It was going great but suddenly today I stumble upon something.

Here what I meant
when I browse the Sofa app and try to create a Post without the title
it prompt with and alert box “The document could not be saved: The database could not be created, the file already exists.” which was weird as looking at the source I found that the require (in validate_doc_update.js return its custom json error) something like in this format {“forbidden” : message }) with forbidden as key

  v.forbidden = function(message) {
      throw({forbidden : message})
  };

   v.require = function() {
        for (var i=0; i < arguments.length; i++) {
          var field = arguments[i];
          message = "The '"+field+"' field is required.";
          if (typeof newDoc[field] == "undefined") v.forbidden(message);
        };
      }; 

in validate_doc_update.js

if (newDoc.type == 'post') {
    if (!v.isAuthor()) {
      v.unauthorized("Only authors may edit posts.");
    }
    v.require("created_at", "author", "body", "format", "title");

inspecting the response state that the json returned was found to be different from the json had it would have been return by the above require function in validate_doc_update.js
here is the json
{“error”:”file_exists”,”reason”:”The database could not be created, the file already exists.”}

This make be believe that the validation in validation_doc_update.js only execute during updating of document

to Prove this point I try to update a document without the title, expecting that it would return the error but surprisingly the document just got saved

so Here are my Question regarding all the Point I mention above

Does validate_doc_update.js “validate” work only during updation of document

if YES 
   then 
      how can I manage to succeed in updating a post without the error [Weird bypassing the Validation Completely] . +  How can execute validation on create of a document
if NO
   then 
     What is  the Error {"error":"file_exists","reason":"The database could not be created, the file already exists."} that is prevent a document to be saved  

Can anyone please share light on all the questions listed here

  • 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-05-25T18:56:27+00:00Added an answer on May 25, 2026 at 6:56 pm

    Yes, the validate_doc_update functions are run only when updating documents (include creation and deletion).

    The function you show here will allow a document without a title as long as its type is not “post”. If you could include the actual request you attempted, I could confirm it.

    Finally, the “”The database could not be created” is because you are attempting to create the database (by doing PUT /dbname/ instead of PUT /dbname/docid, I would guess) when it already exists. Again, if you would include the actual request, I could confirm that too.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.