Hi Jason , do you know how to query with a regular expresion?
I tried this { “area” : /. no se que. / } , it works in Compas .
but when I tried with the data api I needed to put quotes
as this : {“area” : “/. no se que. /”} and this didn’t work
The filter works for regular collections, but time series collections force you to store the time index as a BSON format. I can’t really replicate what JS is doing with the ISODate()-function by hand. I’ve tried all varaiations i could find, timestamps, EJSON formats, regular JSON formats (both found here: ), the suggestion from Jason, nothing works.
I couldn’t find a way to replicate what the ISODate() function does to a string either (I’m no Web / JS dev). Is this a limitation of the data API or am I doing something wrong here?
Tl;dr: I can filter regular collections just by string input, time series collections on the other hand seem to demand BSON timestamps that I can’t replicate with the given data API. Pls Help.
Hi @Jon_Stau the above linked solution from @Jason_Tran should work for you. Time-series collections require the timeField to be stored as a BSONDate type. When using the Data API to query a time-series collection or any other collection the syntax must be valid MongoDB Extended JSON so the ISODate function is not recognized and the DataAPI query should the $date operator to product the same result. For example for a timeField using the field name date: