ok this is driving me crazy..
function(amount){
matchingOrder = Order.findOne({
Price: {
$lte: amount
}
}, {
sort: {
Price: 1,
Order_ID: 1
}
});
}
-----does not work
this works:
function(){
amount = 2
matchingOrder = Order.findOne({
Price: {
$lte: amount
}
}, {
sort: {
Price: 1,
Order_ID: 1
}
});
}
in both cases console.log(amount) is 2 so variable gets passed
...sorry for maybe obvious scope or something..im relativly new at this