Using both development and production views with CouchbaseModelViews framework

Hey,

I am using CouchbaseModelViews framework in my project and enjoy using it.

One option that is missing for me is the option to declare a “CouchbaseDesignDoc” attribute for development and production in the same class.

For example:

[CouchbaseDesignDoc("dev_LevelExperience", "LevelExperience")]
[CouchbaseDesignDoc("LevelExperience", "LevelExperience")]
Public class LevelExperience {}

Currently I can add this attribute only once per class , so I have to manually click on “Publish” button on couchbase console for each design doc in the views tab.

P.S – I am using couchbase .Net sdk 1.3.6 and couchbase server 2.2

Thanks,
Chen

@Chenos

I think to make this work, the CouchbaseDesignDoc would have to have additional overload that took a boolean: isDev. When this is true, it would publish to dev; otherwise it would publish the view in production. At the moment, this doesn’t exist AFAIK.

Your options are two either:

  1. On the CouchbaseModelView project in Github create an issue describing what needs to be done. Wait for it to be addressed.
  2. Since it’s open source project, you could clone it and do it yourself (which would unblock you).

If you chose #2, most definitely submit a pull request so your work can be merged with project and shared with others :smile:

Thanks,

Jeff