debugging view or filter functions in design documents

34 views
Skip to first unread message

Seung Chan Lim

unread,
Sep 27, 2014, 5:24:17 PM9/27/14
to mobile-c...@googlegroups.com
Hi,

Is anyone else using cblite on phonegap (iOS) and debugging views or filter functions in design docs?

I'm trying to figure out how to trace within such a function or at least do print statement style debugging.

I'm debugging directly on the iPhone with console access through safari web inspector.

Any tips you've learned would help me greatly

thank you

slim

Jens Alfke

unread,
Sep 27, 2014, 5:58:38 PM9/27/14
to mobile-c...@googlegroups.com

On Sep 27, 2014, at 2:24 PM, Seung Chan Lim <djs...@gmail.com> wrote:

I'm trying to figure out how to trace within such a function or at least do print statement style debugging.

Unfortunately there isn't a log( ) function in that context. :(

It wouldn't be hard to add one, though — it would be registered in -[CBLJSViewCompiler init], very much the same way as it already registers the emit( ) function. If someone wants to hook it up I'd gratefully accept a pull request.

—Jens

Igor Ievsiukov

unread,
Oct 1, 2014, 4:05:26 AM10/1/14
to mobile-c...@googlegroups.com
afaik 'log' function is not defined it default JS context in CBL iOS.

If do really want to waste some time on this, you can try to use my fork in your project https://github.com/evsukov89/couchbase-lite-ios/commits/sqlcipher

Besides having all usual JS functions defined like in Apache CouchDB, you also will have full support for JS show and list functions.

- Igor
Reply all
Reply to author
Forward
0 new messages