How can I do this. I need to run a function that checks if some value in my collection is false and if it finds something then it checks logic and changes the value to true if the logic is met. I tried to to with Interval but this will cause issue if my collection everything is already changed to true, then there’s no false and the query gives error
I’ve probably misunderstood, but isn’t it sufficient to form the query (for example in a Meteor.publish) to only make available those documents which fulfil the selection criteria? Something along the lines of:
ofc it gives you error, as that productDate is empty and u r accessing its properties as if it was object.
suggestion above is OK too, but if you just want to prevent error you need if condition to check if productDate is not empty and wrap code which depends on it.