How to request query from AWS Amplify with condition(Android Kotlin)?

0

I have a question about use of conditionally requesting AWS Amplify queries.
In the Amplify sample codes, I had to request every queries in database and add them to other array with condition(ex. owner == userId) to use it.

fun queryNotes() {
        Log.i(TAG, "Querying notes")

        Amplify.API.query(
            ModelQuery.list(NoteData::class.java),
            { response ->
                Log.i(TAG, "Queried")
                Log.i(TAG, response.toString())
                for (noteData in response.data) {
                    Log.i(TAG, noteData.name)
                    // TODO should add all the notes at once instead of one by one (each add triggers a UI refresh)
                    UserData.addNote(UserData.Note.from(noteData))
                }
            },
            { error -> Log.e(TAG, "Query failure", error) }
        )
    }

However, if there are lots of queries(over than hundred thousands), i expected that it would cause low service quality such as low speed or excessive use of Amplify server resources.
I want to know whether my expectation is right or wrong.
If it is wrong, I want to know why it is wrong.
If it is right, I want to know how to solve it such as giving condition on the requesting step or setting request condition on the Amplify studio.

已提问 2 年前93 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则