test1.ts 854 B

12345678910111213141516171819202122
  1. import { Observable } from "rxjs"
  2. import { queryService } from "../services/query.service"
  3. import { Entries, Storage } from "../services/query.service"
  4. import { _, isObject } from 'lodash'
  5. let query = new queryService()
  6. let storageAddress: Storage = {
  7. type: "File",
  8. address: "payload.json"
  9. }
  10. let conditions: any[] = [
  11. { "msgDateTime": "2023-01-25T02:54:01.434Z" },
  12. { "msgTag": "enterprise" }
  13. ]
  14. query.query(storageAddress, ...conditions).subscribe((element) => { console.log(`${element.header.messageName} is matched`) })
  15. // the key is to do it in one line. Client just pass 2 arguments, one is the location of the data, which could be file, sql or mongodb, and also
  16. // pass in the conditions of their search enquiries. We will aslo have to cater to different file storage location to determine how to prep the
  17. // data to be filtered