couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Klo <jim....@sri.com>
Subject CommonJS in views
Date Tue, 03 Jul 2012 01:38:08 GMT
Hi,

I have a question regarding CommonJS within views..

Should this work, or is it a bug that it doesn't?  Using CouchDB 1.2.0

{
_id: "_design/commonjs-test",
views: {
lib: {
include1: "var include2 = require('views/lib/include2');  exports.foo1 = include2.foo2;",
include2: "exports.foo2 = 42"
},
my_view: {
map: "function(doc) { emit( require('views/lib/include1').foo1, null); }"
}
}

}

If it should work what might I be doing wrong?

Thanks,

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message