incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: CommonJS in views
Date Tue, 03 Jul 2012 01:52:54 GMT
Hi!

Your case works for me for 1.2.0 release and 1.3.0@master. What result you got?

--
,,,^..^,,,


On Tue, Jul 3, 2012 at 5:38 AM, Jim Klo <jim.klo@sri.com> wrote:
> 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
View raw message