test1.ts 771 B

1234567891011121314151617181920
  1. import { Observable } from "rxjs"
  2. import { queryService } from "../services/query.service"
  3. import { Entries, Storage } from "../services/query.service"
  4. let query = new queryService()
  5. let storageAddress: Storage = {
  6. type: "File",
  7. address: "payload.json"
  8. }
  9. let conditions: Entries[] = [
  10. { msgId: "1e4d25a0-f30f-4590-be24-d43f246cd8c9" }
  11. ]
  12. query.query(storageAddress, ...conditions).subscribe((element) => {console.log(element.header.messageID)})
  13. // 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
  14. // pass in the conditions of their search enquiries. We will aslo have to cater to dffernt file storage location to determine how to prep the
  15. // data to be filtered