Bucket shadowing question

19 views
Skip to first unread message

hie...@bravebits.vn

unread,
Nov 23, 2015, 11:55:27 AM11/23/15
to Couchbase Mobile
Hi guys, 

I got a problem with bucket shadowing, if anyone run into it before, please help me to solve the problem:

  - I have 2 buckets: "mybucket" and "mybucket-shadow"
  - The sync gate way connects to "mybucket" that mobile app could read/write the data.
  - The api (by nodejs) connetcs to "mybucket-shadow" to read/write data

Now my problem is:
 - The mobile app could sync the data from both mybucket and mybucket-shadow, but the api only can retrieve the data from mybucket-shadow :(

Please anyone let me know is there anyway that allows me to query the data from both buckets via node js api? I'm using No1ql to query, it might be a JOIN???



Jens Alfke

unread,
Nov 23, 2015, 12:31:36 PM11/23/15
to mobile-c...@googlegroups.com
On Nov 23, 2015, at 4:40 AM, hie...@bravebits.vn wrote:

 - The mobile app could sync the data from both mybucket and mybucket-shadow, but the api only can retrieve the data from mybucket-shadow :(

That’s by design. You should not use Couchbase smart-client APIs to access SG’s bucket directly*.

Please anyone let me know is there anyway that allows me to query the data from both buckets via node js api? I'm using No1ql to query, it might be a JOIN???

Why do you need to? Can you describe what problem you’re trying to solve?

The shadow bucket has the same data in it. The purpose of shadowing is to give you a separate bucket you can manipulate using Server APIs without confusing Sync Gateway.

—Jens

* except in a very few cases where you need to as a workaround for missing SG functionality
Reply all
Reply to author
Forward
0 new messages