How to bulk import design docs and views to couchbase server
I am using couchbase server in a Java project build with Maven and I want to make some kind of import process every time the DB is deleted, so when I make a new deployment in the development environment, the design documents and the preloaded data are existing in the couchbase server instance.
So I have been trying to use the cbdocloader tool following these instructions:
In theory, this tool supports data and design documents load. I have tested it for documents and it works but I have tried for design documents but this is not working, I don get any error in the console but in the couchbase console there is no design document, what format should have the json?
Yes you can use the cbdocloader tool to import design documents/views.
You just need to create a folder and a file in your import directory/file. something like:
And in this file:
I invite you to look in the beer-sample.zip file.
Note that you can always create views from your code too, as documented here: