簡體   English   中英

如何在 android(java) 中使用 @searchable 在 aws amplify 數據存儲中搜索數據?

[英]How to search data in aws amplify datastore using @searchable in android(java)?

I read this documentation: https://docs.amplify.aws/cli-legacy/graphql-transformer/searchable/#definition But how to impliment the query in android studio using java.What are the methods of Amplify to get search query?

Amplify.DataStore.query(
   Product.class,
   items -> {
       while (items.hasNext()) {
           Product item = items.next();
           Log.i("Amplify", "Id " + item.getId());
       }
   },
   failure -> Log.e("Amplify", "Could not query DataStore", failure)

);

您可以在此處查看完整文檔https://docs.amplify.aws/lib/datastore/data-access/q/platform/android/#create-and-update

還有一些例子https://github.com/enlearacademy/chatme-android-amplify https://aws.amazon.com/es/getting-started/hands-on/build-android-app-amplify/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM