How do I query the data using a column value as a comparison?

I'm looking to find a list of all the results in my Parse database where column a <column b. So far, the closest I have is this (where Qty and QtyMax are columns A and B):

var query = new Parse.Query("Item");
query.lessThan("Qty",0); // In this example I'm passing in an int, 
                         // but I really want to pass in a reference 
                         // to a different column value for the same row.


Return "all rows where Qty <QtyMax" is the desired request.

Any ideas how I would go about this?


source to share

1 answer

Try this (type Pointer may need to be changed to a different type):

query.lessThan("Qty", {__type: "Pointer", className: "Item", objectId: 0});




All Articles