0
我正在使用java。這是我的代碼谷歌雲數據存儲runquery得到日期變量?
RunQueryResponse response = dataset.runQuery("project_name", queryrequest).execute();
and response.tostring()。我有我想要的所有查詢,但有很多。 如何獲得每個字段的單個值。就像把它放在一個數組中,或者我們可以用for循環或interator調用。 感謝
----添加代碼-------- 這裏我的一些代碼:
Iterator<EntityResult> entity_interator = response.getBatch().getEntityResults().iterator();
Map<String, Property> entity;
while(entity_interator.hasNext()){
entity = entity_interator.next().getEntity().getProperties();
String first = entity.get("First").toString();
String last = entity.get("Last").toString();
String time = entity.get("Time").toString();
System.out.println(first);
System.out.println(last);
System.out.println(time);
}
和響應:
{"values":[{"stringValue":"first name"}]}
{"values":[{"stringValue":"last name"}]}
{"values":[{"dateTimeValue":"2013-08-28T08:21:58.498Z"}]}
我怎樣才能得到時間日期時間變量和名字和姓氏與出{{價值觀:[{「stringValue」:「和所有垃圾東西。
方法getEntityResultList()未定義。我正在使用谷歌雲數據存儲與API引擎訪問我的另一個項目數據。 –
您使用的是哪個版本的客戶端庫,以及如何安裝它們? –
我使用com.google.api.services.datastore版本:v1beta1-rev8-1.15.0-rc和com.google.api.services.datastore.model –