Vbucket and Bucket


#1

Hello,

I got 2 questions,

so vbucket is of course the owner of a subset in a key value couchbase cluster. when does the information go from vbucket to bucket, and I am confused, doesnt bucket hold the actual information? i read that vbucket holds the information, so does both places hold it? I always thought vbucket is map, which holds info where the information location is stored on which cluster/node etc.?? when does the data go from vbucket to bucket?

second question, trying to run a simple query on N1QL statement, trying to run a simple select * from gamesim-sample, there is a view already called playerlist, but how do you run a query and choose the bucket you want to query on and then run a select statement on the view or document?

thanks in advanced


#2

OK so finally I found the part were it explains Vbucket and bucket - Me = idiot

so my other question about query on N1QL still stand which is below:

second question, trying to run a simple query on N1QL statement, trying to run a simple select * from gamesim-sample, there is a view already called playerlist, but how do you run a query and choose the bucket you want to query on and then run a select statement on the view or document?

thanks in advanced


#3

Hi, not sure I understand correctly. When you run a N1QL query, the bucket is selected thanks to the FROM keyword. If you want to retrieve all the players in a N1QL query you would write

SELECT * FROM `gamesim-sample` WHERE jsonType = "player";

If you want to select some particular field of the document you just write:

SELECT name,loggedIn FROM `gamesim-sample` WHERE jsonType = "player";

#4

Thank you Idoguin in advance

so if I want to go from lets say

Select * from Bucket then view in bucket, how do I accomplish that?

thanks again :smile: