I have a model defined as follows:
type TempModel @model {
pk: ID! @primaryKey(sortKeyFields: ["sk"])
sk: String!
}
I want to perform a beginsWith
query on the sk
field. I noticed that getTempModel
doesn’t support this since it’s designed to fetch by the primary key + sort key.
However, I found that I can use listTempModels
like this:
listTempModels(pk: "ModelABC123", sk: { beginsWith: "USER#" })
My question is:
Will this use a Query operation behind the scenes (using the primary key and sort key condition), or will it fall back to a Scan operation since it’s not using the filter
argument explicitly?
Thanks!