question on "_removed":true

55 views
Skip to first unread message

Seung Chan Lim

unread,
Nov 26, 2014, 7:48:58 PM11/26/14
to mobile-c...@googlegroups.com
So on my iOS phonegap app I make a HTTP request to my server.

On my server I make a change on a document using python (I actually make an HTTP request to the SGW to do this, even though I'm on the server. That way I take advantage of the async HTTP api instead of the synchronous api provided by Python)

After making the change on the server I get a change notification on my iOS Phonegap app saying that particular document now has a "_removed" : true set on it.

Can someone help me understand why this is?

slim

Jens Alfke

unread,
Nov 26, 2014, 9:20:53 PM11/26/14
to mobile-c...@googlegroups.com

On Nov 26, 2014, at 4:48 PM, Seung Chan Lim <djs...@gmail.com> wrote:

After making the change on the server I get a change notification on my iOS Phonegap app saying that particular document now has a "_removed" : true set on it.

This means the document is no longer accessible to the client because it's no longer in any channels the client has access to. The document seen by the client now has no properties except "_removed":true, and the client won't get any further updates.

—Jens

Seung Chan Lim

unread,
Nov 26, 2014, 9:21:26 PM11/26/14
to mobile-c...@googlegroups.com
As a side note, when I look at the doc directly using the Web interface for couchbase server, I don't see such attribute set. All looks fine. So it's only on the phonegap iOS side that the doc somehow has become removed.

Seung Chan Lim

unread,
Nov 26, 2014, 9:44:33 PM11/26/14
to mobile-c...@googlegroups.com
Ah... Then do I have to assign the doc to a channel every time I make changes to it?

slim

Jens Alfke

unread,
Nov 27, 2014, 12:19:17 AM11/27/14
to mobile-c...@googlegroups.com

On Nov 26, 2014, at 6:44 PM, Seung Chan Lim <djs...@gmail.com> wrote:

Ah... Then do I have to assign the doc to a channel every time I make changes to it?

Yes, but that should happen automatically. The sync function will be called for every change made to the document, and gets to decide what channels it's in. In other words, the document's channels are determined by its content.

—Jens

Seung Chan Lim

unread,
Nov 27, 2014, 10:30:04 AM11/27/14
to mobile-c...@googlegroups.com
Does the same hold true for (access) or can (access) be called just once?

Jens Alfke

unread,
Nov 27, 2014, 1:35:41 PM11/27/14
to mobile-c...@googlegroups.com

On Nov 27, 2014, at 7:30 AM, Seung Chan Lim <djs...@gmail.com> wrote:

Does the same hold true for (access) or can (access) be called just once?

It's all the same. Every time the document is updated the sync function recomputes all of its attributes.

—Jens
Reply all
Reply to author
Forward
0 new messages