Realm query objects by array of ids
See original GitHub issueQuestions: I want to query by a list of ids but I get this error when I try to query by this:
byIds(ids: string[]) {
return this._realm
.objects(Provider)
.filtered('id IN $0',ids)
}
The expression following ‘IN’ must be a keypath to a list
Version of Realm and Tooling
- Realm JS SDK Version: 4.0.0-beta.0
- Node or React Native: 0.61.5
- Client OS & Version: Android
- Which debugger for React Native: None
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Realm Swift - Find by IDs - Stack Overflow
Realm results contain unique objects so the easiest solution is to query for each dog and add the result to an array.
Read more >Querying with Object ID vs Querying with array - MongoDB
I am migrating from another service and changing structure of the database a bit. I already have unique IDs attached to every data...
Read more >Class: Collection - Realm
See: Array.prototype.entries ... Function to execute on each object in the collection. ... Query used to filter objects from the collection.
Read more >Query all objects by array of Ids - Moralis Forum
I would like to run a query, where i know the object ids of the objects to return. I see there is a...
Read more >[Solved]-Realm Swift - Find by IDs-swift - appsloveworld
Realm.objects().filter returns a list of "live", managed objects. It will not return duplicates because there is only one object matching the primary key....
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 Free
Top 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
Next release (v10.20.0) will include an enhancement of the
IN
to support what os requested here.Hi @kneth,
First of All, thanks for this realease,
I have a question plz, what about ‘NOT IN’, how can i achieve this case ?
UPDATE
I use
NOT id IN {1,2,3,4}
, and it’s work!!!