How can I do an optional where clause in building the query? #1940
Answered
by
dfahlander
laukaichung
asked this question in
Q&A
Replies: 1 comment
-
const collection = value
? table.where('value').equals(value)
: table.toCollection();
return collection
.offset(getOffset(page, itemsPerPage))
.limit(itemsPerPage)
.reverse()
.toArray(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
laukaichung
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm stuck at building a query. Would you please tell me how to do an optional where clause? The
where()clause doesn't return the table instance.Beta Was this translation helpful? Give feedback.
All reactions