[GH-ISSUE #235] filter on nested data and IN operator for string type #105

Closed
opened 2026-05-23 08:30:56 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @fabriciovasc on GitHub (Jul 12, 2023).
Original GitHub issue: https://github.com/appy-one/acebase/issues/235

I had two problems with query filter of collection. First example, I have nested object with 3 properties and I need to filter them.

const data = [
  { id: 1, owner: { user: 'xxx', friend: 'xxx' } }
  { id: 2, owner: { user: 'yyy', friend: 'yyy' } }
]

Based on the docs and issue https://github.com/appy-one/acebase/issues/62 that should look something like:

db.query(collection).filter('owner/user', '==', 'xxx')

But after the query I don't have any values. Is there another way to filter nested objects?


Second example, I have string property which can have multiple values and I try to filter using IN operator. That should look something like:

const data = [
  { id: 1, status: 'SYNCED' }
  { id: 2, status: 'DISABLED' }
]

db.query(collection).filter('status', 'in', ['SYNCED', 'DISABLED'])

But after the query I don't have any values. Is there another way to filter string property with multiple values? Something like MongoDB query with $in operator

Originally created by @fabriciovasc on GitHub (Jul 12, 2023). Original GitHub issue: https://github.com/appy-one/acebase/issues/235 I had two problems with query filter of collection. First example, I have nested object with 3 properties and I need to filter them. ```ts const data = [ { id: 1, owner: { user: 'xxx', friend: 'xxx' } } { id: 2, owner: { user: 'yyy', friend: 'yyy' } } ] ``` Based on the docs and issue https://github.com/appy-one/acebase/issues/62 that should look something like: ```ts db.query(collection).filter('owner/user', '==', 'xxx') ``` But after the query I don't have any values. Is there another way to filter nested objects? _______ Second example, I have string property which can have multiple values and I try to filter using IN operator. That should look something like: ```ts const data = [ { id: 1, status: 'SYNCED' } { id: 2, status: 'DISABLED' } ] db.query(collection).filter('status', 'in', ['SYNCED', 'DISABLED']) ``` But after the query I don't have any values. Is there another way to filter string property with multiple values? Something like MongoDB query with $in operator
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#105
No description provided.