import { Observable } from "rxjs" import { queryService } from "../services/query.service" import { Conditions, Storage } from "../services/query.service" import { _, isObject } from 'lodash' let query = new queryService() let storageAddress: Storage = { type: "File", address: "payload.json" } let conditions: Conditions[] = [ { 'msgTag': ['free'] } ] let conditions2: Conditions[] = [ { "msgId": "4f710c4b-a258-4c7e-a4b6-6095bb7028e9" }, { "msgLogDateTime": "2023-01-14T21:50:19.917Z" }, ] let conditions3: Conditions[] = [ { "regex": "cum incidunt maxime voluptatibus" } ] query.query(storageAddress, ...conditions3).subscribe((element) => { console.log(`${element.header.messageName} is matched`) }) // query.query(storageAddress, ...conditions2).subscribe((element) => { console.log(`${element.header.messageName} is matched`) }) // 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 // 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 // data to be filtered