You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good to show examples of querying on a GSI in the documentation. I was scratching my head for a while because I had code like this:
asyncfunctionfind(pk: string,skPrefix?: string,index?: MyIndexEnum): Promise<Foo[]>{letquery=store.query().wherePartitionKey(pk);if(index){query=query.index(index);}if(skPrefix&&!isEmpty(skPrefix)){query=query.whereSortKey().beginsWith(skPrefix.toLowerCase());}console.debug(`Query ${index||'table'} for "${pk}" begins_with(${skPrefix})`);returnquery.exec();}
I didn't realize that you had to call .index(...)before calling wherePartitionKey. That seems a bit counterintuitive on this builder pattern, but if it was documented along with the query documentation, that'd make it easy to see.
The text was updated successfully, but these errors were encountered:
It would be good to show examples of querying on a GSI in the documentation. I was scratching my head for a while because I had code like this:
I didn't realize that you had to call
.index(...)
before callingwherePartitionKey
. That seems a bit counterintuitive on this builder pattern, but if it was documented along with the query documentation, that'd make it easy to see.The text was updated successfully, but these errors were encountered: