tywalch / electrodb

A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.
MIT License
956 stars 58 forks source link

Doc example incorrect and misleading #374

Closed iOSonntag closed 1 month ago

iOSonntag commented 2 months ago

Hey folks, GREAT JOB on ElectroDB absolutely dope what you have build!!

Just a quick note on one doc example I found to be misleading. In the ConditionExpression section under examples here in the "dynamic" filtering example is a logical issue (I think).

As I understood the framework, chained where clauses lead to implicit ANDs and if thats the case then the example will never ever return any item. That is because it tries to find an item where the keeper attribute is two different values at the same time (pratically impossible).

My suggestion would be to update the example to use OR instead, but I am not sure how to do this in order for the example to still contain that for loop. That is why I have not edited the page.

tywalch commented 2 months ago

Great catch! I usually accept and merge pretty much any documentation PRs; I'm not very opinionated about how an inaccurate example would be changed, so if you wanted to remove the loop entirely (for example) I'd be totally fine with that. If you'd like to make a PR I'd stamp it, otherwise I'll note this for my next documentation commit!

iOSonntag commented 2 months ago

@tywalch Alright I just reversed the condition to not equal ne() that should do the trick I guess. Pull request #379

iOSonntag commented 1 month ago

Closed with merge of #379