I am trying to query for all documents before a given timestamp, but that timestamp may not exist at the time of the query. I keep getting this error.
FirebaseError: Function Query.where() requires a valid third argument, but it was undefined.
I've looked at using promises, async and await, but I'm still a bit lost.
var myTimeStamp; //might not have a value yet
function loadTimeStamp(){...};
loadTimeStamp(); //function is called give myTimeStamp a value
//firebase onSnapshot call throws error
ref.where('timestamp', '<', myTimeStamp).onSnapshot(snapshot =>{ ... });
I'm probably missing something very simple. Any help is greatly appreciated!