File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,17 @@ describe('DataClient tests', () => {
255255 expect ( result [ 0 ] ?. key1 ) . toBeInstanceOf ( Date ) ;
256256 expect ( promise ) . toEqual ( data ) ;
257257 } ) ;
258+
259+ it ( 'get tabular data from MQL with useRecentData = true' , async ( ) => {
260+ const promise = await subject ( ) . tabularDataByMQL (
261+ 'some_org_id' ,
262+ [ { query : 'some_mql_query' } ] ,
263+ true
264+ ) ;
265+ const result = promise as typeof data ;
266+ expect ( result [ 0 ] ?. key1 ) . toBeInstanceOf ( Date ) ;
267+ expect ( promise ) . toEqual ( data ) ;
268+ } ) ;
258269 } ) ;
259270
260271 describe ( 'tabularDataByFilter tests' , ( ) => {
Original file line number Diff line number Diff line change @@ -153,11 +153,14 @@ export class DataClient {
153153 *
154154 * @param organizationId The ID of the organization that owns the data
155155 * @param query The MQL query to run as a list of BSON documents
156+ * @param useRecentData Whether to query blob storage or your recent data
157+ * store. Defaults to false
156158 * @returns An array of data objects
157159 */
158160 async tabularDataByMQL (
159161 organizationId : string ,
160- query : Uint8Array [ ] | Record < string , Date | JsonValue > [ ]
162+ query : Uint8Array [ ] | Record < string , Date | JsonValue > [ ] ,
163+ useRecentData ?: boolean
161164 ) {
162165 const binary : Uint8Array [ ] =
163166 query [ 0 ] instanceof Uint8Array
@@ -166,6 +169,7 @@ export class DataClient {
166169 const resp = await this . dataClient . tabularDataByMQL ( {
167170 organizationId,
168171 mqlBinary : binary ,
172+ useRecentData,
169173 } ) ;
170174 return resp . rawData . map ( ( value ) => BSON . deserialize ( value ) ) ;
171175 }
You can’t perform that action at this time.
0 commit comments