Quantcast
Channel: Mobile - Couchbase Forums
Viewing all articles
Browse latest Browse all 1122

Try to understand the difference between Database and Bucket from sync gateway perspective

$
0
0

I can create a json document via sync gateway via the REST API call

curl -X POST “http://localhost:4984/mydb/” -H “accept: application/json” -H “Content-Type: application/json” -H “Authorization: Basic ENCODED_AUTH” -d “{"data":"My Content"}”

the command returned
{“id”:“4ef823d4b6f706e1ad4a900ec1ff51ab”,“ok”:true,“rev”:“1-21c3fa97d6140d81e9a66c0a536ffa36”}

and I am able to get the data by the “id”
curl -X GET “http://localhost:4984/mydb/21c3fa97d6140d81e9a66c0a536ffa36” -H “accept: application/json” -H “Authorization: Basic ENCODED_AUTH”

it’s all working, however it’s confusing to me that the keyspace in REST API does not require Bucket name, so how can I find the new document in CB Server?
I also run
http://localhost:4985/mydb/_replicationStatus?includeConfig=true
the config returned don’t have any information regarding bucket.

Is it a correct understanding that sync gateway pass the JSON data to CB server, then CB server decide the “default” bucket to hold the data, or is there any specific config that I haven’t discovered that can push the JSON document to a bucket?

Currently I can only verify the data exist by running the “GET” curl command, but can’t find that JSON file anywhere in the CB server

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1122

Trending Articles