Re: Invalid attachment error while trying to resolve a conflict

2018-09-13 Thread Brendan Duddridge
Thanks for your response Jens. The reason I got myself into this pickle is because I was attempting to solve a problem where attachments were going missing during a conflict, so I was merging the _attachments dictionaries from the conflicted revisions to prevent attachment file loss. So I

Re: Invalid attachment error while trying to resolve a conflict

2018-09-12 Thread Brendan Duddridge
. Thanks, Brendan On Saturday, March 24, 2018 at 7:47:49 PM UTC-6, Brendan Duddridge wrote: > > Hi, > > I'm trying to resolve a conflict in my database and during processing of > the conflicts, I try to save the new revision and I get the following error: > > *19:33:51.584|

Re: LiteCore and CouchDB replication

2018-09-01 Thread Brendan Duddridge
It would be great to be able to sync from CouchbaseLite 2.x to CouchDB. But I don't think they support that. It's what's keeping me from upgrading to 2.x. Brendan On Saturday, September 1, 2018 at 6:32:33 PM UTC-6, Adam Wilson wrote: > > > I'm trying to replicate from CouchDB using LiteCore

Re: CouchbaseLite and CouchbaseLiteListener as frameworks with module support

2018-08-17 Thread Brendan Duddridge
I got it compiling now by adding the following directly to the Listener IOS Library target: MyRegexUtils.m ExceptionUtils.m CollectionUtils.m Test.m Test_Assertions.m And now it runs and now I can move on. Thanks! Brendan -- You received this message because you are subscribed to the Google

Re: CouchbaseLite and CouchbaseLiteListener as frameworks with module support

2018-08-17 Thread Brendan Duddridge
, not being exposed by the dynamic framework. I feel like I'm so close to getting it... Thanks, Brendan On Friday, August 17, 2018 at 12:16:52 PM UTC-6, Jens Alfke wrote: > > > > > On Aug 17, 2018, at 10:34 AM, Brendan Duddridge > wrote: > > > > Is this because I'm u

CouchbaseLite and CouchbaseLiteListener as frameworks with module support

2018-08-17 Thread Brendan Duddridge
Hi, I'm trying to utilize CBL 1.4.2 in a Swift app extension, so I need to build the dynamic framework version of CBL. That seems to be ok when I build the iOS Framework - Carthage version (built right from within Xcode, not actually using Carthage). But when I do that and try to compile my

Re: Throw away all unsaved CBLModels in one go

2018-05-22 Thread Brendan Duddridge
To answer my own question, this seemed to have worked: NSArray *unsavedModels = self.databaseDocument.couchDatabase.unsavedModels; for (CBLModel *model in unsavedModels) { [model revertChanges]; } -- You received this message because you are subscribed to the Google Groups "Couchbase

Throw away all unsaved CBLModels in one go

2018-05-22 Thread Brendan Duddridge
Hi, Is it possible to throw away all CBLModels that have been created? I created them in a loop, but don't want to save them if the user clicks the Cancel button. So I don't want subsequent saveAllModels calls to save any of the objects I want to throw out. I know there's an unsavedModels

Re: "not_found" error trying to delete a CBLDocument on iOS 11.3 (CBL 1.4.1)

2018-04-04 Thread Brendan Duddridge
Ok, I'll create a GitHub issue for it. Thanks, Brendan On Wednesday, April 4, 2018 at 12:10:18 PM UTC-6, Jens Alfke wrote: > > > > On Apr 4, 2018, at 12:00 AM, Brendan Duddridge <bren...@gmail.com > > wrote: > > Is there any way that I can get rid o

Re: "not_found" error trying to delete a CBLDocument on iOS 11.3 (CBL 1.4.1)

2018-04-04 Thread Brendan Duddridge
Also, I ran the Compact Database function on the database hoping that a good vacuum and compaction would resolve the problem. But it didn't help. Thanks, Brendan -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this

Invalid attachment error while trying to resolve a conflict

2018-03-24 Thread Brendan Duddridge
Hi, I'm trying to resolve a conflict in my database and during processing of the conflicts, I try to save the new revision and I get the following error: *19:33:51.584| Database: PUT _id=rec-3c73468b47e78a82b574c9e1d44f, _rev=38-910e724b542aaa5c6b224bf992e6de09 (allowConflict=1)*

Handling dates with timezones

2018-03-10 Thread Brendan Duddridge
Hi, In CouchbaseLite I've been using [CBLJSON dateWithJSONObject:] and [CBLJSON JSONObjectWithDate:] to retrieve and store date information. The date in the database looks like this in UTC: { date = "2018-01-12T07:00:00.000Z"; } But I'd like to store the time zone information now along

Re: purgeDocument within inTransaction creating sub-transactions

2018-01-08 Thread Brendan Duddridge
Ah ok. Thanks Jens for confirming that there's still only one database write at the end when the parent transaction is committed. I've seen this behaviour when calling deleteLocalDocument as well. > > I'll do some profiling then. Thanks, Brendan -- You received this message because you are

purgeDocument within inTransaction creating sub-transactions

2018-01-07 Thread Brendan Duddridge
Hi, I'm writing a method for macOS and iOS using CBL 1.4.1 which purges all the deleted documents in the database. But when I run my code, it looks like all the calls to purgeDocument are creating and committing its own transactions, even though I've surrounded the purgeDocument call within a

Re: 400 HTTP error trying to access database from Apple Watch on iPhone when it's locked

2018-01-03 Thread Brendan Duddridge
Thanks for the tip Jens. I did initialize my NSError variable prior to executing that code: NSError *error = nil; But I've just reworked it as you suggested, so I'll see if that solves the problem. Thanks! Brendan -- You received this message because you are subscribed to the Google

Re: 400 HTTP error trying to access database from Apple Watch on iPhone when it's locked

2018-01-02 Thread Brendan Duddridge
> The error message refers to opening the database, but your email implies > the database is already open. Do you know which API call this error is > returned from? And is anything being logged before this error? > > This isn’t the error I’d expect when the filesystem is locked. In 1.4 and >

400 HTTP error trying to access database from Apple Watch on iPhone when it's locked

2018-01-02 Thread Brendan Duddridge
Hi, Whenever I try to fetch from the CBL 1.4.1 database when my iPhone is locked via a message sent from my Apple Watch app, I get the following error in the device's console log: Jan 1 22:18:22 iPhone-X Tap Forms[11762] : Error opening Tap Forms database: Error Domain=*CBLHTTP Code=400*

Re: Multipart Uploader & document body request size

2017-12-08 Thread Brendan Duddridge
So here's something interesting. IBM has their own Cloudant CDTDatastore framework for iOS that syncs with their Cloudant system. Most of the code was written by you Jens :) And they also do multipart/related uploads. So I suspect the developers who used their own CDTDatastore framework are

Re: Cloudant 10 requests per second limit

2017-12-08 Thread Brendan Duddridge
Hi Traun, Looks like this is the code in question: > > > https://github.com/couchbase/couchbase-lite-ios/blob/9a8903b9e851d5584abeec069ead4d2637b3bb91/Source/CBLMisc.m#L381 > Ah excellent! I've added a check for the 429 error to tell it to return NO that's it's not a fatal error. Now I just

Re: Cloudant 10 requests per second limit

2017-12-08 Thread Brendan Duddridge
Hi Jens, Sync Gateway will sometimes return a 503 if the DB server is overloaded; > CBL handles that by trying again a bit later. What status code does > Cloudant return? > Where in CBL does it handle the 503 error and try again? Do you think I could just modify the code to also do the same

Re: Cloudant 10 requests per second limit

2017-12-05 Thread Brendan Duddridge
> Sync Gateway will sometimes return a 503 if the DB server is overloaded; > CBL handles that by trying again a bit later. What status code does > Cloudant return? > > It looks like it's a 429 -- too many requests error. https://console.bluemix.net/docs/services/Cloudant/api/http.html#http

Re: Cloudant 10 requests per second limit

2017-12-05 Thread Brendan Duddridge
Ya, I didn't think it ran any queries. But it would be good if it could handle the response code and then try again in a little bit. On Tuesday, December 5, 2017 at 3:48:17 PM UTC-7, Jens Alfke wrote: > > > No, there’s nothing like that, because it’s never been an issue before. > (FWIW, the

Re: Cloudant 10 requests per second limit

2017-12-05 Thread Brendan Duddridge
Yes, that is a limitation with the free tier. But their older Cloudant service didn't have this limitation and I had a lot of customers using it. So now I'm starting to field all these support requests. Just trying to figure out what to do now and how to handle it. -- You received this

Couchbase Server admin page?

2017-12-05 Thread Brendan Duddridge
Hi, Apache CouchDB has their Project Fauxton web interface for administering the CouchDB databases. Does Couchbase have anything like that? Right now I'm still using Couchbase Lite 1.4 because I'm waiting for support for CBLModel and hoping there could be some way to integrate with Apache

Cloudant 10 requests per second limit

2017-12-05 Thread Brendan Duddridge
Hi, IBM has changed their system so that it only allows for a limited number of requests per second: - 20 Lookups/sec - 10 Writes/sec - 5 Queries/sec I was wondering if there was anything in Couchbase Lite 1.4 which could throttle the number of lookups per second, writes per second

Re: Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
Looking at the code, I think the *only* case where the push replicator > sends attachments as inline base64 is if the server doesn’t support > multipart … I believe this was for compatibility with old versions of > PouchDB. Otherwise it’s always multipart. > > —Jens > > PS: If you’re

Re: Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
Hi Jens, Are these guidelines public? I’d like to see more detail. > Yes, here's some docs mentioning the 1 MB limit: https://console.bluemix.net/docs/services/Cloudant/api/document.html#documents Specifically: Note: If you are using a Cloudant NoSQL DB service on IBM Bluemix >

Re: Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
Hi Priya, > I will DM you regarding this. There are couple of other hosting partners > like zData that our partner teams can make introductions to if you'd like. > We > recently went through this exercise with another company who was migrating > away from Cloudant (not for the attachment

Re: Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
This is what they told me: For ordinary attachments, there is no limitation on the size. You can upload any attachment as you like. But for inline attachment, there is a limitation because inline attachments are attachments included as part of the JSON content. The document size limit on the

Re: Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
S3) > > That seems like a it's going to affect *a lot* of Cloudant users and > maybe with some pressure from users they might consider increasing it. > > On Friday, December 1, 2017 at 1:45:16 AM UTC-8, Brendan Duddridge wrote: >> >> Hi, >> >> So my customers have

Multipart Uploader & document body request size

2017-12-01 Thread Brendan Duddridge
Hi, So my customers have been informed that Cloudant is moving their shared cluster to a new IBM Cloud system. They want all my customers that are using the old Cloudant to transfer over to new IBM Cloud Cloudant service. The problem I'm facing now in relation to Couchbase Lite 1.4.x is that

Re: How does CBL 1.4 unique CBLAttachments?

2017-11-09 Thread Brendan Duddridge
Turns out it WAS a bug in my code. And oddly enough I couldn't reproduce it because the version I was using had this bug fixed inadvertently. I had recently fixed a crash, so I reworked some code in my file attachments controller and it turns out that fixed this uniquing problem too! But

Re: How does CBL 1.4 unique CBLAttachments?

2017-11-09 Thread Brendan Duddridge
> The digest is a SHA-1 digest of the attachment data. (It has nothing to do > with the name.) It would be astronomically unlikely for two attachments > with different data to produce the same digest. > > … *unless* these happen to be the two specific PDFs that were created to > demonstrate a

How does CBL 1.4 unique CBLAttachments?

2017-11-09 Thread Brendan Duddridge
Hi, I have a customer who has a strange problem. He's attaching PDF files to different documents, but the PDF files have the same filename. They differ only slightly in their content. It appears that the digest internal to the CBLAttachment is the same for these different files so they end up

Re: Is there a way to fetch only the deleted documents?

2017-10-25 Thread Brendan Duddridge
Sure, I can do that. But I know you're going to want a sample application that demonstrates the problem with a sample database. It'll take me some time to put that together. On Wednesday, October 25, 2017 at 12:31:07 PM UTC-6, Jens Alfke wrote: > > > > On Oct 25, 2017, at 10:42

Re: Is there a way to fetch only the deleted documents?

2017-10-25 Thread Brendan Duddridge
> You can replace this with just > if (revision.isDeletion) { > > —Jens > Thanks for the tip Jens. I've just done that. But I still get the WARNING: Couldn't load body/sequence of CBLSavedRevision error. I've modified my code as follows: NSArray *leafRevisions = [row.document

Re: Getting error loading parent revision's properties

2017-10-24 Thread Brendan Duddridge
> > Looks like the parent revision’s body has been compacted away. CBL doesn’t > guarantee to keep past revisions around; it’s not a version-control system. > If you’re using SQLite storage they should stick around until you manually > compact, though. > Is there a way to preempt this error?

Re: Is there a way to fetch only the deleted documents?

2017-10-24 Thread Brendan Duddridge
> You mean existingDocumentWithID, right? (Local docs are different.) Yes, > I’m pretty sure it returns the document (though I’m getting rusty on 1.x so > don’t take that as gospel.) Actually yes, I did mean existingDocumentWithID. I mistyped. Sorry about that. What I found out that

Getting error loading parent revision's properties

2017-10-23 Thread Brendan Duddridge
Hi, When I attempt to get a CBLRevision's parent revision properties, I'm getting the following error: *01:58:52.774*‖* WARNING: Couldn't load body/sequence of CBLSavedRevision[itm-..ee61/1-3cba2f866ae42de425f82828079eaf31]: 404 {at -[CBLSavedRevision loadProperties]:215}* I'm trying to

Is there a way to fetch only the deleted documents?

2017-10-23 Thread Brendan Duddridge
I need to be able to fetch the deleted documents. I've setup an allDocumentsQuery with kCBLIncludeDeleted as the allDocsMode But I don't want the non-deleted documents to be fetched. Because if I have 10,000 documents and 1 has been deleted somewhere, I don't want to have to loop through all

Re: Trying to restore deleted documents, but not getting the revision data

2017-10-18 Thread Brendan Duddridge
And it turns out that I don't need to get the parent's revision. In fact, that may be nil. So instead I can just get the properties from the current revision from the leaf node and that works a charm. -- You received this message because you are subscribed to the Google Groups "Couchbase

Re: Trying to restore deleted documents, but not getting the revision data

2017-10-18 Thread Brendan Duddridge
Ok, I figured it out. I need to call getLeafRevisions on my deleted CBLDocument. That actually gives me the revisions and then I can ask for the parentRevison in order to get the properties. Then I need to take the original deleted revision and create a new revision from it, set the isDeleted

Re: Trying to restore deleted documents, but not getting the revision data

2017-10-18 Thread Brendan Duddridge
On Tuesday, September 13, 2016 at 11:30:47 PM UTC-6, Brendan Duddridge wrote: > > Hi, > > I've written a small bit of code to try and restore deleted documents, but > I'm coming up a bit empty. > > Here's what I've got so far: > > - (IBAction)recoverDeletedDocs:(id)s

Re: Trying to save just before macOS app quits

2017-10-16 Thread Brendan Duddridge
On Monday, October 16, 2017 at 3:38:32 PM UTC-6, Brendan Duddridge wrote: > > Hi Jens, > > Thanks for your response. > > I tried that. > > Unfortunately for some reason I can't get CBL to stop on any breakpoints. > > I'm building (command-b) from the CBL Mac scheme

Re: Trying to save just before macOS app quits

2017-10-16 Thread Brendan Duddridge
Hi Jens, Thanks for your response. I tried that. Unfortunately for some reason I can't get CBL to stop on any breakpoints. I'm building (command-b) from the CBL Mac scheme and then going to Products, show in Finder, then copying the CouchbaseLite.framework into my project. Then I run my

Trying to save just before macOS app quits

2017-10-16 Thread Brendan Duddridge
Hi, So I've got code to trap when a window closes and when my application quits. I'm observing the NSApplicationWillTerminateNotification notification and saving to the database before the application quits. Unfortunately I'm finding that the CBLManager is being closed before I get a chance

Fetching results by sequence number

2017-09-10 Thread Brendan Duddridge
Hi, I've got an import routine which reads in a CSV file and creates CBLDocuments. I'd like to query those documents but ordered by the same order they were imported in. I know that an all docs query can be ordered by kCBLBySequence, but can I do that with a regular CBLView? Thanks,

Re: Multiple deletes of the same document possible?

2017-08-23 Thread Brendan Duddridge
Sorry to send you on a wild goose chase! > No worries. It's good to explore all avenues. > And now I don't understand what's going on with that database. :( > Me neither. Maybe because I use putExistingRevision heavily? And perhaps the revision histories are getting messed up causing

Re: is it possible to share cbl local db to another device local db by Airdrop ?

2017-08-23 Thread Brendan Duddridge
You might want to look at Multipeer Connectivity. Then zip your file and send it over to another device using: [self.mySession sendResourceAtURL:[NSURL fileURLWithPath:zipFilePath] withName:[selectedFileURL lastPathComponent] toPeer:peer withCompletionHandler:^(NSError * _Nullable error)

Re: Multiple deletes of the same document possible?

2017-08-22 Thread Brendan Duddridge
Hi Jens, I just looked at the fix for the .Net implementation and it appears to just be a slight modification to the SQL for pruning. Would it be appropriate then to modify the CBL_SQLiteStorage.m file around line 2261 and change the SQL to the following? // There are no branches, so just

Re: CBL macOS versions

2017-08-14 Thread Brendan Duddridge
Hi Jens, However, we’ve recently decided to embed SQLite in the CBL framework itself > to ensure that we always have a compatible version, so we’re no longer > dependent on what version is in the OS.) > Will that include an SQLCipher implementation? Thanks, Brendan -- You received this

Re: Is CBLModel still in the pipeline for CBL 2.0?

2017-08-07 Thread Brendan Duddridge
Hi Jens, PS: I’m not trying to pass the buck, but: models can be implemented on top > of the document API without any access to private APIs. So it’s the kind of > feature anyone could add. A good starting point would be the CBLModel > implementation from 1.x, although it would be changed

Re: Questions about 2.0

2017-08-07 Thread Brendan Duddridge
Hi Jens, Do you know if CBLModel is still on tap for CBL 2.0 / 2.1? Thanks, Brendan -- 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

Is CBLModel still in the pipeline for CBL 2.0?

2017-08-01 Thread Brendan Duddridge
As the subject says... Will you still be adding CBLModel to CBL 2.0? Thanks, Brendan -- 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

Re: Error 400 - Invalid database/document/revision ID

2017-07-24 Thread Brendan Duddridge
> Hm. Another thing is that when you’re adding a doc with a revision > history, the generation numbers in the rev IDs have to be strictly > consecutive; no skipping or backtracking. > Ah interesting. That could be the problem. I'll have to look for that. Thanks. I worked around the problem

Re: Error 400 - Invalid database/document/revision ID

2017-07-22 Thread Brendan Duddridge
Well that didn't work. You can't ignore the revision IDs because it's needed to recreate the document. I'm using this code to import the data: BOOL success = [newDoc putExistingRevisionWithProperties:jsonObject attachments:attachmentProps revisionHistory:revIds fromURL:nil error:]; I tried

Re: Error 400 - Invalid database/document/revision ID

2017-07-22 Thread Brendan Duddridge
On Saturday, July 22, 2017 at 1:07:25 PM UTC-6, Jens Alfke wrote: > > That’s quite odd. There shouldn’t be any way for an invalid revID to get > into a database. I hope the file isn’t corrupted. There’s no easy way to > find out where in the code the error originates because it isn’t thrown as

Error 400 - Invalid database/document/revision ID

2017-07-22 Thread Brendan Duddridge
Hi, I'm getting this error when trying to save any CBLModel to the database. This is on macOS 10.12.6. *Error Domain=CBLHTTP Code=400 "Invalid database/document/revision ID" UserInfo={NSLocalizedFailureReason=Invalid database/document/revision ID, NSLocalizedDescription=Invalid

Re: Syncing with couchdb : are views pulled?

2017-07-08 Thread Brendan Duddridge
Only documents are synced. You'll just have to define the same views in Couchbase Lite that you have in CouchDB. Then they'll be maintained by Couchbase Lite. -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group

Re: Conflict when saving, but no conflicts found

2017-06-26 Thread Brendan Duddridge
Sure, I'll do that if I encounter this problem with a test database of mine. This was a customer's database, so I wouldn't be able to send it. Thanks, Brendan On Monday, June 26, 2017 at 10:02:18 AM UTC-6, Jens Alfke wrote: > > I’m stumped by this issue; if you ever get a database that

Re: Conflict when saving, but no conflicts found

2017-06-24 Thread Brendan Duddridge
> What do you mean by “renamed”? Document IDs are immutable. > > So is this problem specific to bulk-saving models, not when you save them > individually? > By "renamed", I meant just changed the name property of my model object. Not the Document ID. Sorry for the confusion. It affected

Re: Conflict when saving, but no conflicts found

2017-06-24 Thread Brendan Duddridge
So I somehow managed to delete that field model object that was causing the conflict whenever I did batch saves. I renamed it, but I'm sure I got another conflict error trying to save it. Then I renamed a different field model object in my database and it saved properly because I was not

Re: Conflict when saving, but no conflicts found

2017-06-23 Thread Brendan Duddridge
There seems to be just one CBLModel in my database that's causing this problem. I tried to delete it, but it also gets a conflict error: *15:27:40.365| Database: }} Commit transaction (level 2)* *15:27:40.366| Database: DELETE _id=fld-f3c90dfa980a435ab72046e1deff8939,

Re: Conflict when saving, but no conflicts found

2017-06-23 Thread Brendan Duddridge
Thanks Jens. So I tried that and it didn't seem to work: Here's my output: *14:29:39.155| Database: {{ Begin transaction (level 1)...* *14:29:39.156| Database: PUT _id=fld-f3c90dfa980a435ab72046e1deff8939, _rev=2-387048e2ded3cc92db4332743b9e1221 (allowConflict=0)* *14:29:39.156| Database: }}

Re: Conflict when saving, but no conflicts found

2017-06-23 Thread Brendan Duddridge
It seems to do this when using [CBLModel saveModels: modelsToSave error: outError]; When I save an individual model I don't get a conflict. But there are a few other models that need saving at the same time, so that's why I'm using the above. There must be something wrong with one of the

Conflict when saving, but no conflicts found

2017-06-23 Thread Brendan Duddridge
Hi, I'm getting the following error trying to save my CBLModels: *Error saving field: Error Domain=CBLHTTP Code=409 "conflict" UserInfo={NSLocalizedFailureReason=conflict, NSLocalizedDescription=conflict}* *2017-06-23 12:13:57.298774-0600 Tap Forms Mac 5[60432:8772572] Conflicted documents:

Re: Japanese/Chinese/Korean FTS search

2017-06-17 Thread Brendan Duddridge
> > > Yes, that’s part of what's being added in iOS 11 / macOS 10.13. Watch the > session. > > —Jens > I watched the session. They didn't really touch on Asian languages unfortunately. However, although my above sample didn't work to split the 2 characters apart, a larger example seemed to

Re: Japanese/Chinese/Korean FTS search

2017-06-16 Thread Brendan Duddridge
nguage words as I hoped. Thanks, Brendan On Friday, June 16, 2017 at 6:55:22 PM UTC-6, Jens Alfke wrote: > > > On Jun 16, 2017, at 5:21 PM, Brendan Duddridge <bren...@gmail.com > > wrote: > > Has anyone solved the problem with searching Japanese, Chinese, or Korean >

Japanese/Chinese/Korean FTS search

2017-06-16 Thread Brendan Duddridge
Has anyone solved the problem with searching Japanese, Chinese, or Korean words with FTS in Couchbase Lite? This looked like a potential solution: https://blog.kapeli.com/sqlite-fts-contains-and-suffix-matches Has anyone done anything like this with CBL? Thanks, Brendan -- You received

Re: Updating a CBLModel vs doc update method.

2017-04-27 Thread Brendan Duddridge
I just use the CBLModel save function. I only drop down to the CBLDocument level when I need to do bulk changes to documents. I don't know if there's a difference though because as far as I understand, when the underlying CBLDocument is changed, that propagates to the CBLModel. On Monday,

Re: FTS substring search

2017-04-21 Thread Brendan Duddridge
: > > > On Apr 20, 2017, at 3:14 PM, Brendan Duddridge <bren...@gmail.com > > wrote: > > It tokenizes every character in the FTS index allowing you to do substring > searches. Perfect for languages such as Chinese, Japanese, and Korean where > words aren't necessarily bounde

FTS substring search

2017-04-20 Thread Brendan Duddridge
I just stumbled across this GitHub project: https://github.com/haifengkao/SqliteSubstringSearch It tokenizes every character in the FTS index allowing you to do substring searches. Perfect for languages such as Chinese, Japanese, and Korean where words aren't necessarily bounded by spaces.

Re: Questions about 2.0

2017-04-14 Thread Brendan Duddridge
Hi Jens, Thanks for your reply. (A final thought:t it would be a Simple Matter Of Programming™ for someone > to build a CouchDB-compatible replicator on top of Couchbase Lite 2.0. Just > pull the replicator code out of any platform of 1.x, change the API calls > to fit 2.0, and superglue it

Re: Questions about 2.0

2017-04-13 Thread Brendan Duddridge
straight -- will get > back to you. > > On Wed, Apr 12, 2017 at 2:35 PM, Brendan Duddridge <bren...@gmail.com > > wrote: > >> >> >> By "*new replication protocol*", will that still be compatible with >>>> CouchDB and Cloudant? >>>> &

Re: Storing large files especially zip in couchbase

2017-04-13 Thread Brendan Duddridge
I just read the stream from CBLAttachment's content and write it out to the temp folder or to a folder of the user's choosing. So even though the file on disk is a .blob, when the user chooses to save the file out from the database, the filename I present to them is the same used as the

Re: Questions about 2.0

2017-04-04 Thread Brendan Duddridge
Hi Jens, You may have missed seeing my question last week, so I thought I'd post it again: You said: We’ll be including a build of Sync Gateway that supports *the new > replication protocol*. > By "*new replication protocol*", will that still be compatible with CouchDB and Cloudant? Will

Re: Questions about 2.0

2017-03-28 Thread Brendan Duddridge
> Replication is coming in DP4, this Friday. We’ll be including a build of > Sync Gateway that supports the new replication protocol. > By "new replication protocol", will that still be compatible with CouchDB and Cloudant? Will 2.0 be able to sync with 1.4 over peer-to-peer? Just curious

Re: Questions about 2.0

2017-03-28 Thread Brendan Duddridge
Totally understand not supporting CBLView and Map/Reduce. And you're right, I can manually support local documents with a separate database file just for that that's not synced. It was just convenient to call putLocalDocument on the current database. I've just been patiently waiting for

Re: Questions about 2.0

2017-03-27 Thread Brendan Duddridge
That would be awesome. A simple way to query based on keys would be great too. Right now when I want to clear out a whole bunch of key/values from the local document store I have to fetch regular documents, loop through them, then delete the ones that have matching keys. I'm using this for

Re: Questions about 2.0

2017-03-27 Thread Brendan Duddridge
I just thought of another feature I use regularly in CBL 1.4. Local Documents. Will 2.0 still support them? I use it extensively for CloudKit syncing that I recently added. Plus I also store other bits of data there that don't need to be synced, such as a list of devices that are setup for

Re: Questions about 2.0

2017-02-16 Thread Brendan Duddridge
Hi Jens, I'm glad that inserting existing revisions will be supported and P2P as well. We’re currently not planning to have geo-query in 2.0. It's only ever been > available on iOS/Mac, and I don’t know how many people have used it. It > wouldn’t be that hard to reimplement in LiteCore and

Using createAllDocumentsQuery with limit to get count of all documents without limit

2017-02-15 Thread Brendan Duddridge
Hi, I'm doing an all docs query without and with a limit. Basically I'm looping through all my documents one batch at a time, but I'd like to find out how many records there are in total that match the query first before I break it up into batches. You know, so I can have a proper progress

Re: How does 2.0 deal with CBLViews?

2017-02-07 Thread Brendan Duddridge
As for feedback on the inclusion of CBLViews in 2.0, I would like that because it will make transitioning to the new query language easier. If I can run my app almost as is with 2.0 and then migrate my queries over that would be ideal. Then I can take a phased approach to converting. It already

Re: How does 2.0 deal with CBLViews?

2017-02-06 Thread Brendan Duddridge
Thanks for all that info Jens. Very helpful. then you want an index on [type, cost] Is it possible to build indexes given a keyPath? In my model I have a structure like this: "form" : "frm-41ebd7ee0d024aaf95c37d2cd10c0072", "values" : { "fld-92b86046b

How does 2.0 deal with CBLViews?

2017-02-06 Thread Brendan Duddridge
Hi Jens et. al., CBL 1.x creates separate tables in the underlying SQLite database to hold the results from the map/reduce functions. Fetching from the database was fast because essentially the results were pre-computed. With 2.0 it looks like a lot of work is going into the query syntax to be

Re: ANN: Invitation to try LiteCore (the 2.0 client engine in development)

2017-01-08 Thread Brendan Duddridge
> When you declare a FTS index, there’s a “language” parameter that > specifies which stemming to use. If you set it to null, there won’t be any > stemming. > Oh that's awesome. I didn't know about that. Thanks! Also, will it still support this kind of code? (or an equivalent): BOOL

Re: ANN: Invitation to try LiteCore (the 2.0 client engine in development)

2017-01-07 Thread Brendan Duddridge
I just watched your video presentation for 2.0. Looks pretty exciting. For the FTS engine, will we be able to turn off the stemmers by default? I had to modify the CBL_SQLiteViewStorage code slightly to disable stemming because it caused problems with the queries. Also, I'm assuming that the

Re: ANN: Invitation to try LiteCore (the 2.0 client engine in development)

2017-01-07 Thread Brendan Duddridge
Interesting! I see that SQLite is the official back-end. Does that mean that you'll no longer be supporting ForestDB? Although I'm not using ForestDB right now because of its limited FTS capabilities, I was just curious. And will the database schema be compatible with the 1.x schema? Will

Couldn't load body of ... status 404

2016-12-08 Thread Brendan Duddridge
Hi, I'm suddenly seeing a bunch of 'couldn't load body of' errors displayed when working with a ForestDB database. 11:44:44.852| WARNING: : Couldn't load body of pik-95e6de68c7c844ed91c38377085c5355 (seq 2847): status 404 {at -[CBL_ForestDBQueryEnumerator generateNextRow]:204} 11:44:44.857|

Re: CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-21 Thread Brendan Duddridge
Hi Jens, Thanks very much for all the guidance here. I've been combing through my code now ensuring that I am not referencing self (even implicitly) within my MAPBLOCK code. I'm passing in only the data that I need from my model objects as immutable properties (and copies for NSStrings, etc.)

Re: CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-21 Thread Brendan Duddridge
I'm reworking all of my calls to setMapBlock so that I pass in pure values and never any references to any model objects now. So hopefully that'll cure the problem I'm having. I still need to know certain properties from my model objects in order to figure out what keys and values to emit

Re: CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-20 Thread Brendan Duddridge
And another thing I see that I'm doing within the MAPBLOCK is I'm calling a method to fetch a value from the database depending on some situation. I'm guessing that's also not allowed within a MAPBLOCK? Here's what I'm doing within the MAPBLOCK in order to determine what value to emit in this

Re: CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-19 Thread Brendan Duddridge
I tried posting this before, but the formatting got screwed up, so I'll just summarize the post I just deleted (there's no edit function that I can see). In the header docs on CBLView on setMapBlock it says this: It is very important that this block be a law-abiding map function! As in >

Re: CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-19 Thread Brendan Duddridge
One other thing that perhaps I'm doing that I shouldn't be is from this note in the header docs: It is very important that this block be a law-abiding map function! As in > other languages, it must be a "pure" function, with no side effects, that > always emits the same values given the same

CBL 1.3.1 Mac: Is calling setMapBlock meant to be called just once per app launch?

2016-11-19 Thread Brendan Duddridge
Hi, So every time I fetch from my database, I call the setMapBlock function on my CBLView. Could this cause problems? Is this a normal thing to do or should setMapBlock be called only one time upon application startup? Sometimes the parameters I use within the map block change so I update the

Does the Shared CBLManager get created even when never accessed?

2016-10-31 Thread Brendan Duddridge
I have logging turned on so I can see when my CBLManager instance gets closed. I'm finding something odd. When I close my CBLManager, it looks like there's another instance that's getting closed. I only created one instance. I'm not using the shared CBLManager instance at all. I never

Is CBLManager close method synchronous?

2016-10-31 Thread Brendan Duddridge
Hi Is the [CBLManager close] method synchronous or asynchronous? I know it not only closes the database, but also stops replications and calls saveAllModels before it closes the database. Just wondering if the app will block while the close method is executing? I would like it to block because

Re: Display All records of database

2016-10-18 Thread Brendan Duddridge
You can create an allDocuments query to get a list of all documents in the database. As for printing/displaying them, that ball is in your court for Android :) On CBLDatabase there's a method called createAllDocumentsQuery which returns a CBLQuery object. Use that to fetch all your documents.

Re: Checking for relationship existence in a CBLModel subclass causes model instance to be created

2016-10-05 Thread Brendan Duddridge
> What’s the value of the JSON “linkToForm" property in the document? > - If it’s nil, then the Obj-C .linkToForm property should be nil. > - If it’s not nil, then it will instantiate (or reuse) a model on a > document with that ID. (Yes, even if it doesn’t exist in the db yet) > Ah ok, that

Checking for relationship existence in a CBLModel subclass causes model instance to be created

2016-10-05 Thread Brendan Duddridge
Hi, I've got a small bit of code that's checking to see if a relationship exists in my model. The leaf of the relationship is a CBLModel subclass. It seems that when I do this check, Couchbase Lite (iOS 1.3.1) is creating a model object for the checked property. But I don't want it to do that

  1   2   3   4   >