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.

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen