File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,17 @@ describe('DataClient tests', () => {
255
255
expect ( result [ 0 ] ?. key1 ) . toBeInstanceOf ( Date ) ;
256
256
expect ( promise ) . toEqual ( data ) ;
257
257
} ) ;
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
+ } ) ;
258
269
} ) ;
259
270
260
271
describe ( 'tabularDataByFilter tests' , ( ) => {
Original file line number Diff line number Diff line change @@ -153,11 +153,14 @@ export class DataClient {
153
153
*
154
154
* @param organizationId The ID of the organization that owns the data
155
155
* @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
156
158
* @returns An array of data objects
157
159
*/
158
160
async tabularDataByMQL (
159
161
organizationId : string ,
160
- query : Uint8Array [ ] | Record < string , Date | JsonValue > [ ]
162
+ query : Uint8Array [ ] | Record < string , Date | JsonValue > [ ] ,
163
+ useRecentData ?: boolean
161
164
) {
162
165
const binary : Uint8Array [ ] =
163
166
query [ 0 ] instanceof Uint8Array
@@ -166,6 +169,7 @@ export class DataClient {
166
169
const resp = await this . dataClient . tabularDataByMQL ( {
167
170
organizationId,
168
171
mqlBinary : binary ,
172
+ useRecentData,
169
173
} ) ;
170
174
return resp . rawData . map ( ( value ) => BSON . deserialize ( value ) ) ;
171
175
}
You can’t perform that action at this time.
0 commit comments