I was trying to find out the existence of a document with ID (say, 'abcd') in a database and I went with -existingDocumentWithID:. But it doesn't returns me nil when a document with ID doesn't exists in local DB(I cross checked using CouchbaseLiteViewer app for Mac). Replacing -existingDocumentWithID: with -existingLocalDocumentWithID: always returns me nil, even when document with ID does exists on local database. Could you please guide me here? How can I check existence of document with ID?
Thanks!
--
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-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/819f68b4-5503-415e-b449-c1457e71f865%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hm ... yes, there might be a bug in the iOS implementation. It looks like if you've previously accessed the document with that ID (which doesn't exist), then a future call to existingDocumentWithID: will return that cached CBLDocument object. I should fix that.
It looks like if you’ve previously accessed the document with that ID (which doesn’t exist), then a future call to existingDocumentWithID: will return that cached CBLDocument object.
Check whether document.currentRevision != nil.
Just checked in a fix, btw. (Only in the master branch for now, but it’ll be in 1.0.)
*** ASSERTION FAILED: Cannot reindex view 'type/project' which has no map block set*** Assertion failure in -[CBLView(Internal) updateIndex](), /Users/Ajith/couchbase-lite-ios/Source/CBLView+Internal.m:184
- (void)replicationProgress:(NSNotificationCenter *)notify {
CBLReplication *repl = castIf(CBLReplication, [notify valueForKey:@"object"]);
CBLDatabase *db = [self.manager existingDatabaseNamed:repl.localDatabase.name error:nil];
if (!db)
return;
//remaining good stuff here . .
}
Question here is, why would replication send a notification when database doesn't exists in local?