0
我試圖從2個桶中檢索數據,沒有錯誤,但沒有出現(我確實有我需要在這些桶中的文檔)。Couchbase N1QL查詢正在運行,但沒有檢索到數據(錯誤的查詢,我猜)
1桶:a_bucket
這裏是我感興趣的(我有3個不同的文檔)
AUTHOR_ID文檔的文檔:
{
"author_ID": 1,
"profil_creation_date": "2017/01/01/01:23:05/+5",
"prefix": "Mr.",
"first_name": "Dylan",
"middle_name_s": "Alfred",
"last_name": "Kerr",
"date_of_birth": "1974/01/02",
"sex": "M",
"marital_status": "Single",
"mobile_phone": "(860) 231-3336",
"address": [
{
"address_1": {
"address_ID": 1,
"home_address": "338 Counts Lane",
"city": "West Hartford",
"province/state": "CT",
"postal_code": "06105"
}
},
{
"address_2": {
"address_ID": 2,
"work_address": "977 Copperhead Rd",
"city": "Newington",
"province/state": "CT",
"postal_code": "06111"
}
}
]
}
第二桶:b_bucket
這裏是我感興趣的2個文檔:
p_ou tput_ID文件:
{
"p_output_ID": 1,
"author_ID": 2,
"overall_score": 4.41,
"status": {
"r_status_first": "TRUE",
"r_status_second": "FALSE",
"r_status_third": "YES",
"y_status_second": "TRUE",
"y_status_third": "FALSE",
"g_status_third": "TRUE"
}
}
timing_ID文件:
{
"timing_ID": 1,
"p_output_ID": 1,
"author_ID": 1,
"date_and_time": "2017-06-06/23:45:25.25/+5",
"time_in_seconds": 12525,
"incremental_time_in_seconds": "time_in_seconds",
"current_state_and_duration": {
"state": "RED",
"duration_in_seconds": 33333
}
}
我的目標是在一個查詢()抓取這些信息:
前綴,FIRST_NAME,middle_name_s,姓氏(來自author_ID文檔中的a_bucket) overall_score(來自b_bucket中的p_output_ID文檔) date_and_time,state(from timin在b_bucket G_ID文件)
這裏是我的查詢:
select p2.current_state_and_duration.state, p1.overall_score, p2.date_and_time
from proc_data_bucket p1 USE KEYS "p_output_ID"
JOIN proc_data_bucket p2 ON KEYS "author_ID";
的語法是確定的,但我沒有得到任何數據
請幫我說...
這已在couchbase論壇中得到解答https://forums.couchbase.com/t/querying-documents-from-2-different-buckets-help/13594/2 – vsr