123456789101112131415161718192021222324252627 |
- 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" },
- ]
- query.query(storageAddress, ...conditions).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
|