> On Nov 17, 2014, at 4:02 PM, Christoph Berlin <[email protected]> 
> wrote:

> However when running the delete function it seems that something causes the 
> sync gateway to throw the following error:

It looks as though your sync function doesn't properly handle deletions and 
throws a JavaScript TypeError exception. It's not immediately obvious to me 
what the error in the sync function is; using the log( ) function can help you 
troubleshoot it.

Deletions can be a bit tricky to handle because the regular deleteDocument 
method replaces the body of the document with nothing but a "_deleted":true 
property — so there's no "type", or any of your other properties. In some cases 
for correct validation you may need to delete the document by explicitly 
setting "_deleted":true without removing the other properties; you can do this 
by creating a new CBLRevision, setting its deletion property to YES, and saving 
it.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/471299C9-F30B-4BA9-A3BF-EC54C36A8B0F%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to