iOS:CBL 2.0: Some questions.

26 views
Skip to first unread message

parvez....@decurtis.com

unread,
Jul 9, 2018, 2:08:53 AM7/9/18
to Couchbase Mobile
Below are some queries related to CBL 2.0:
1. How we can have access to revision of a document like the class CBLRevision in CouchbaseLite 1.4.1? Or the things like this is no more available in 2.0?
2. For a document having zip file as attachments which may be as big as 20MB, it seems we have to use InputStream for downloading it, right? If Yes, then what will be the attachment url that the input stream will use to download it?
3. In 1.4.1, we do have NSProgress class available to measure the download progress of attachments which seems no more available in 2.0 then how one will measure the download progress?

Thanks

parvez....@decurtis.com

unread,
Jul 9, 2018, 6:54:13 AM7/9/18
to Couchbase Mobile
   4. When a document is deleted, what the databaseChangeListener will return in that case? How a deletion will be identified in this case? 

Thanks

Jens Alfke

unread,
Jul 9, 2018, 1:15:15 PM7/9/18
to mobile-c...@googlegroups.com

On Jul 8, 2018, at 11:08 PM, parvez....@decurtis.com wrote:

1. How we can have access to revision of a document like the class CBLRevision in CouchbaseLite 1.4.1? Or the things like this is no more available in 2.0?

Revisions aren't available in the public API because we didn't see enough use cases for them (Couchbase Lite is not a version control system!), and leaving them out simplifies our architecture.

2. For a document having zip file as attachments which may be as big as 20MB, it seems we have to use InputStream for downloading it, right? If Yes, then what will be the attachment url that the input stream will use to download it?

No, you can get the attachment data directly as a [NS]Data object.
If you get it as a stream, there is no URL associated with the stream. It's just an NSInputStream.

3. In 1.4.1, we do have NSProgress class available to measure the download progress of attachments which seems no more available in 2.0 then how one will measure the download progress?

Attachments are download as part of replication, not when you access them. The overall replication progress includes the progress of attachments being downloaded.

   4. When a document is deleted, what the databaseChangeListener will return in that case? How a deletion will be identified in this case? 

The listener still tells you the IDs of the changed docs, including the deleted ones. If you try to get a deleted document, you'll get a not-found error.

—Jens
Privacy Policy | Update Marketing Preferences

parvez....@decurtis.com

unread,
Jul 11, 2018, 9:47:02 AM7/11/18
to Couchbase Mobile
Thanks Jens for the replies.

Below are some more questions:
1. It seems deferred download of attachments has been removed in CBL 2.0 for iOS, right?
2. For a document D1 that is having attachment A1 (initially). If we updated some properties of the document and also updated the attachment such that it is now A2, then how CBL 2.0 will be able to identify if the attachment is available as A1 or A2? In short, we want to know how CBL 2.0 distinguishes updates in attachment in the document?

Thanks

On Monday, July 9, 2018 at 10:45:15 PM UTC+5:30, Jens Alfke wrote:

Jens Alfke

unread,
Jul 11, 2018, 11:53:55 AM7/11/18
to mobile-c...@googlegroups.com

> On Jul 11, 2018, at 6:47 AM, "parvez....@decurtis.com" <parvez....@decurtis.com> wrote:
>
> 1. It seems deferred download of attachments has been removed in CBL 2.0 for iOS, right?

Yes. Or rather, it wasn’t a fully cross-platform feature in 1.x, and going forward we’re only releasing features with cross-platform support. We hope to (re)implement this soon in a future release.

> 2. For a document D1 that is having attachment A1 (initially). If we updated some properties of the document and also updated the attachment such that it is now A2, then how CBL 2.0 will be able to identify if the attachment is available as A1 or A2? In short, we want to know how CBL 2.0 distinguishes updates in attachment in the document?

By the ‘digest’ property in the blob metadata stored in the document, which is a base64-encoded SHA-2 digest of the contents.

—Jens
Privacy Policy<https://www.couchbase.com/privacy-policy> | Update Marketing Preferences<https://info.couchbase.com/unsubscribe-or-manage-preferences>
Reply all
Reply to author
Forward
0 new messages