2

私はgeodeが初めてです。
私は以下のように追加しています:

gfsh>put --key=('id':'11') --value=('firstname':'Amaresh','lastname':'Dhal') --region=region
Result      : true
Key Class   : java.lang.String
Key         : ('id':'11')
Value Class : java.lang.String
Old Value   : <NULL>   

このようにクエリすると:

gfsh>query --query="select * from /region"

Result     : true
startCount : 0
endCount   : 20
Rows       : 9

Result
-----------------------------------------
('firstname':'A2','lastname':'D2')
HI
Amaresh
Amaresh
('firstname':'A1','lastname':'D1')
World
World
('firstname':'Amaresh','lastname':'Dhal')
Hello

NEXT_STEP_NAME : END

以下のようにクエリを実行しようとすると、値が取得されません。

gfsh>query --query="select * from /region r where r.id='11'"

Result     : true
startCount : 0
endCount   : 20
Rows       : 0


NEXT_STEP_NAME : END

もちろん、getコマンドを使用できます...しかし、where条件を使用したい..間違っているところ..出力がありません

ありがとう

4

3 に答える 3

2

Geode では、キーは「単なる別の列」ではありません。実際、基本的なクエリ構文は、値のフィールドのみを暗黙的にクエリします。ただし、次の構文を使用してクエリにキーを含めることができます。

key.id=11 の /region.entries から value.lastname、value.firstname を選択します

また、厳密には必須ではありませんが、値クラスに id フィールドを含めることはかなり一般的な方法です。

于 2015-11-30T18:30:37.863 に答える
1

get コマンドを使用して、特定のキーに関連するデータを取得できます。

get --key=<KEY_NAME> --region=<REGION_NAME>

例:

get --key=1 --region=Address

参照: https://gemfire.docs.pivotal.io/910/geode/tools_modules/gfsh/command-pages/get.html

于 2020-08-04T15:58:20.217 に答える