How to do OR statements??? Docs are completely empty unfortunately
See original GitHub issueSummary:
How to use the .or()
statement?
I’ve also checked the mongoose docs
Code sample:
query('ownerId').eq(a).or().eq(b)
query('ownerId').eq(a).or({ownerId: a}).or({ownerId: b})
Current output and behavior:
Invalid Query state: %s must follow query(), where() or filter()
Expected output and behavior:
Be able to or the query
Environment:
Operating System:
Operating System Version:
Node.js version (node -v
):
NPM version: (npm -v
):
Dynamoose version: 1.11.1
Type (select 1):
- Bug report
- Feature suggestion
- Question
- Other suggestion
- Something not listed here
Other:
- I have read through the Dynamoose documentation before posting this issue
- I have searched through the GitHub issues (including closed issues) and pull requests to ensure this issue has not already been raised before
- I have searched the internet and Stack Overflow to ensure this issue hasn’t been raised or answered before
- I have tested the code provided and am confident it doesn’t work as intended
- I have ensured that all of my plugins that I’m using with Dynamoose are listed above
- I have filled out all fields above
- I am running the latest version of Dynamoose
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Word file corrupted - has gone blank but still displays word count
The first thing you'll want to do is make a copy so that any further fiddling doesn't get your text further disguised. In...
Read more >Opening Word Documents Shows a Blank Screen
Workaround 1 · Click on File > Options · Go to Add-ins · Under 'Manage' select 'COM Add-ins' and click 'Go…' image.png ·...
Read more >Focus on content with the new Pageless option in Google Docs
But in February 2022, Google Docs announced a new pageless option for Google Docs, which removes both the empty space around the page...
Read more >Troubleshoot Google Docs, Sheets, Slides & Forms error ...
If you get an error message such as "Something went wrong. Reload" or "Unable to load file" preventing you from making edits on...
Read more >6 Solutions on Folder Shows Empty But Files Are There ...
If you encounter a problem that the folder shows empty but files are there on Windows 10/11, no worries!! This post will walk...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cupcakearmy
Couple things here. It’s highly discouraged to do Scan’s in DynamoDB, since it has to search through every document you have. At scale this is not good in terms of performance at all. Of course, you did run into the big requirement about Query’s, you must query for where the hashKey = something. You can’t do an
OR
for that hashKey without doing multiple Query’s.Without knowing more about your data structure I can’t really help give any suggestions for how to restructure your data. But chances are you might want to change your data structure so the performance is better.
On a side note. The reason I’m replying to this closed issue is that in Dynamoose v2, I just added support for
OR
statements to Scan, Query & Conditionals along with groups. However if you want to keep using Scan, usingin
is probably the easiest for your use case.However, as I said above, I’d consider rethinking how you think about your data. Checkout this video for more info on that: https://youtu.be/DIQVJqiSUkE.
Thanks for the response. Switched to Google cloud though and I will never go back to crap AWS xD