When inserting a new design document via the Mock backup manager (this method: https://github.com/couchbase/couchnode/blob/master/lib/mock/bucketmgr.js#L14), the logic at this line is incorrectly determining that the design document already exists: https://github.com/couchbase/couchnode/blob/master/lib/mock/bucketmgr.js#L17
I believe the logic should look something like this:
Steps to reproduce:
- use the official v2.0.0 Node.js module.
- start with an empty database or one with no views in it at least.
- create a Node.js app that connects to couchbase using the mock implementation.
- insert a design document via the bucket manager.
- observe that you get an error telling you that the design document exists, when of course it doesn’t.
Would be great to know if this fix is correct and have it merged into the official module.
(Node.js API v2.0.0.)