Restricting Document Updates in CouchDB

Restricting Document Updates in CouchDB

Follow Josh Morony on

Learn Ionic with Josh ☕

Hey, I hope you enjoy the article.

If you want a weekly update with my newest content, access to the blog's bonus content, or you want to sign up for one of my free beginner or advanced email courses just enter your details here or in the form below.

CouchDB exposes a powerful REST API that allows you to interact with the database by making simple HTTP requests. The simplicity of CouchDB is one of its great features, but we might not always want to just blindly create or update documents.

Perhaps we want to check that a user can only modify their own documents, or perhaps we want to ensure that all documents conform to a specific format.

When using CouchDB, we can create something called a validate_doc_update function, which allows us to inspect incoming documents, and compare them to the previous version of the document. Within this function, we can create logic to determine whether to accept or reject a particular update.

In this video tutorial, we take a look at creating a basic validate_doc_update function in CouchDB.

Click here to watch the video on YouTube

If you enjoyed this article, feel free to share it with your friends ☝

Check out my latest videos: