Dave K
Dave K

Reputation: 1694

adding comments to a couchdb design doc

Is there a way to enter comments into a couchdb design doc?

The queries can get pretty cryptic, and it would be really nice to be able to write a brief human description of what they do.

Upvotes: 2

Views: 365

Answers (1)

Dominic Barnes
Dominic Barnes

Reputation: 28429

If you want to add comments to your JS code, that's fine.

function (doc) {
  // comments are ok here
  if (doc.type === 'user') emit(doc.username);
}

However, you can't add comments to the outer JSON, since JSON doesn't support comments.

{
  "views": {
    "by-name": {
      // you can't put comments here
      "map": "function (doc) { ..."
    }
  }
}

Upvotes: 4

Related Questions