使用 php couchbase sdk,我有一个索引各种对象类型的视图。
直接点击视图返回结果没问题
http://127.0.0.1:8092/default/_design/dev_domain/_view/search?stale=false&connection_timeout=60000&limit=10&skip=0&startkey=%22S%22&endkey=%22S\u02ad%22
快乐地返回
{"total_rows":700,"rows":[
{"id":"TestCompany\\Model\\SampleObject\\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef","key":"sam","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4","key":"sam","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef","key":"samp","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4","key":"samp","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef","key":"sampl","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4","key":"sampl","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef","key":"sample","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4","key":"sample","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef","key":"sampled","value":"SampleData"},
{"id":"TestCompany\\Model\\SampleObject\\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4","key":"sampled","value":"SampleData"}
]
}
但是使用php sdk:
$test = $cb->view("dev_domain", "search",array("startkey"=>"s","endkey"=>"s"."\u02ad"));
不返回任何结果,使用 3 个或更多键即可,即:
$test = $cb->view("dev_domain", "search",array("startkey"=>"sam","endkey"=>"sam"."\u02ad"));
Array
(
[total_rows] => 700
[rows] => Array
(
[0] => Array
(
[id] => Authentic\Model\SampleObject\b63008d6d65df09a6947a9c3ebb9f3137ed3c54ac3754a21ba2098d80537c3ef
[key] => sam
[value] => SampleData
)
[1] => Array
(
[id] => Authentic\Model\SampleObject\f6b4119f7373edb6cfc7901702a2bb81b655834cd009cdfcaaafbaa1991f2cc4
[key] => sam
[value] => SampleData
)
)
)
我不知道如何通过 charles (proxy) 通过管道传输 sdk,所以没有任何运气调试..