Couchbase Sync Gateway 2

Hi, I am trying Sync Gateway and I was hoping that the system will allow me to make modifications to the documents via n1ql or using the admin UI, but I just learn that is not possible since version 2.0 does not support shadow buckets anymore… So in version 2.0 is there a way for perform and update or insert on the server so this changes to be applied to the mobile application ???

Absolutely. In 2.0, you have shared bucket access which effectively allows you to sync changes make through admin UI or SDK /N1QL without needing to shadow buckets.

Check out the documentation and this blog post that discusses the concept and how to enable it.

Hi, thanks for your help, it turn outs the documentation is right, now with 2.0 version we can INSERT new documents using for example C# SDK or directly from the Admin UI using N1QL, but… what happens with updates and deletes, those operations do not work at least we use the Sync Gateway REST API… there is some C# SDK that use this API? or does the current C# SDK supports deletes and updates wich works seameslly whit the Gateway???

And by the way the insert via N1QL works fine until we started to work with channels, once we specify a channel on android the only way it works is if we use the sync gateway API, the problem with using that API is that our current application is a C# web application that uses the C# SDK… so we will need to code a layer to make INSERTS, UDATES and DELETES different from that SDK, that is just a bummer right now, we kind of thought if we uses the current c# SDK and perform does operations, the sync gateway would understand it and keep all working out of the box… :frowning:

@pablo.pinargote, you’ve got two good points there. Me and my team started using SyncGateway (SG) even before 1.5, in a time when it was encouraged to go always just through SG’s REST API to write directly to the buckets. I am kind of happy that they want to finish this restriction, nevertheless it seems there is still job to do (as you yourself have discovered).

@priya.rajagopal, i read your post when it was still quite fresh (end last year), and then i was disappointed by the fact that “there is no way to query for the document sync metadata via the server’s N1QL interface”. Now it is almost one year gone since your original post and SG has gone from 1.5 to 2.0. Has something changed in the mean time? are we now able to get the sync metadata via the server’s N1QL interface? Is this happening soon? Personally i find it is a pity we have to use the REST API instead of the CB SDK since there we have no access to N1QL…

@priya.rajagopal, i read your post when it was still quite fresh (end last year), and then i was disappointed by the fact that “there is no way to query for the document sync metadata via the server’s N1QL interface”. Now it is almost one year gone since your original post and SG has gone from 1.5 to 2.0. Has something changed in the mean time? are we now able to get the sync metadata via the server’s N1QL interface? Is this happening soon? Personally i find it is a pity we have to use the REST API instead of the CB SDK since there we have no access to N1QL…

Yes. StartingCBS 5.5 (EE in GA now) we support the ability to query for sync metadata via N1QL.

So you will able to issue a query equivalent to this
SELECT meta().xattrs._sync from travel-sample where Meta().id = "user::demo";

Those are really good news!