Closed adilansari closed 1 year ago
This would be great as it greatly simplifies the filtering syntax.
/bounty 200
💎 $200.00 bounty created by ovaistariq
👉 To claim this bounty, submit a pull request that includes the text /claim #268
somewhere in its body
📝 To receive payouts, join Algora and complete the relevant onboarding steps
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to tigrisdata/tigris-client-ts!
Hi @ovaistariq and @adilansari,
I'd love to work on this issue. Can anyone walk me through the process?
I noticed that @adilansari, said in his comment above that, modifying the function to this 👇🏼 would suffice.
const productsCursor = catalog.findMany({
filter: {
"$or": [
{ brand: "adidas" },
{ "$lt": { price: 50 } },
],
},
});
Would that be all I need to do?
Yes. The goal is to simplify filter definition for end users and retain full capability to define complex filters.
Following is the type definition for filters: https://github.com/tigrisdata/tigris-client-ts/blob/0edc5cad4761d12f08f80e6b7427d53ace40b4c2/src/types.ts#L700-L715
These filters are defined by end users and then serialized to strings here: https://github.com/tigrisdata/tigris-client-ts/blob/0edc5cad4761d12f08f80e6b7427d53ace40b4c2/src/utility.ts#L81-L96
Here are the test cases and examples: https://github.com/tigrisdata/tigris-client-ts/blob/0edc5cad4761d12f08f80e6b7427d53ace40b4c2/src/__tests__/tigris.filters.spec.ts#L15
And some usage in Tigris official documentation here.
Ayy! Great!
I'll have a look, and give you feedback, as soon as possible.
That sounds great.
💡 kaf-lamed-beyt submitted a pull request that claims the bounty. You can visit your org dashboard to reward.
https://github.com/tigrisdata/tigris-client-ts/pull/310#issuecomment-1518662463 @kaf-lamed-beyt Since you've stopped working on this. I will pick this up.
Yes, please. That sounds good. 👌🏽
💡 akhill10 submitted a pull request that claims the bounty. You can visit your org dashboard to reward.
🎉🎈 @akhill10 has been awarded $200.00! 🎈🎊
Make
Filter<T>
more user friendly.Example
Existing filter spec:
can be improved to: