webda.io icon indicating copy to clipboard operation
webda.io copied to clipboard

Store add a find

Open loopingz opened this issue 1 year ago • 2 comments

We could have something to simplify querying with:

.find({
  status: "open"
  })

It would default to AND query and we could implement something like the mongodb syntax if needed.

loopingz avatar Mar 20 '24 16:03 loopingz

You mean faster than Query.filter: Expression ?

abalam666 avatar Mar 21 '24 08:03 abalam666

https://github.com/loopingz/webda.io/blob/e912bfca379b9979f812680f82619e6b3be5784e/packages/core/src/stores/store.ts#L2476

  type QueryMap = { [key: string]: string };
  abstract find(query: WebdaQL.Query | QueryMap ): Promise<StoreFindResult<T>>;

Would it be possible to guess a better precision expected type instead of a standard object key/value QueryMap ? i mean considering we should be helped by the Sotre's Model?... i don't see how to use it correctly

abalam666 avatar Mar 21 '24 08:03 abalam666