Home > Net >  AWS Amplify DataStore filtering not working
AWS Amplify DataStore filtering not working

Time:11-20

I'm using AWS Amplify framework, i have a list of products, each product contains a price, when i run :

DataStore.query(Product)

to get all the products it works fine, but when i run the query below to get the products with price greater than 10 :

DataStore.query(Product, c => c.price.gt(10));

i got an error TypeError: c.price.gt is not a function !

this is how it described in docs

CodePudding user response:

This way below worked perfectly !

DataStore.query(Product, (c) => c.price('gt', 10))

  • Related