I have a situation in a customer's database where he has a basically empty 
record that can't be deleted.

I traced through the code and found that CBL (1.4.1) is returning 
kCBLStatusNotFound when trying to delete (or even modify) the document.

Here's the relevant code being executed in CBL_SQLiteStorage.m (1728) in 

- (CBL_Revision*) addDocID: (NSString*)inDocID

                 prevRevID: (CBL_RevID*)inPrevRevID

                properties: (NSMutableDictionary*)properties

                  deleting: (BOOL)deleting

             allowConflict: (BOOL)allowConflict

           validationBlock: (CBL_StorageValidationBlock)validationBlock

                    status: (CBLStatus*)outStatus

                     error: (NSError**)outError


        SequenceNumber parentSequence = 0;

        if (prevRevID) {

            // Replacing: make sure given prevRevID is current & find its 
sequence number:

            if (isNewDoc)

                return kCBLStatusNotFound;

            parentSequence = [self getSequenceOfDocument: docNumericID 
revision: prevRevID

                                             onlyCurrent: !allowConflict];

            if (parentSequence == 0) {

                // Not found: kCBLStatusNotFound or a kCBLStatusConflict, 
depending on whether there is any current revision

                if (!allowConflict && [self existsDocumentWithID: docID 
revisionID: nil])

                    return kCBLStatusConflict;


*                    return kCBLStatusNotFound;*


In bold red is the line that's being executed.

Is there any way that I can get rid of this document even though the 
parentSequence is 0 and it falls through to the else statement? I just want 
to be able to delete it and move on. But it's preventing any documents in a 
batch transactions from being saved if this document appears in the 
transaction block being saved.



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 mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to