Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of primitive types for List #5489

Closed
mitevdev opened this issue Nov 26, 2017 · 2 comments
Closed

Support of primitive types for List #5489

mitevdev opened this issue Nov 26, 2017 · 2 comments

Comments

@mitevdev
Copy link

mitevdev commented Nov 26, 2017

Goals

class Entry : Object {
   ...
   dynamic var tags = List<String>()
}

and then:

let results = realm.objects(Entry.class).filter("any tags == %@", "foo")   // or
let results = realm.objects(Entry.class).filter("any tags contains[c] %@", "foo") // or
let results = realm.objects(Entry.class).filter("any SELF.tags in %@", ["foo"])

Expected Results

Results populated with Entry objects having "foo" in tags field

Actual Results

'Invalid value', reason: 'Expected object of type (null) in IN clause for property 'tags' on object of type 'Entry', but received: foo'

Steps to Reproduce

just create a realm and put one instance of Entry class then try to fetch it by searching by tags

Code Sample

Version of Realm and Tooling

ProductName:	Mac OS X
ProductVersion:	10.13.1
BuildVersion:	17B48

/Applications/Xcode.app/Contents/Developer
Xcode 9.1
Build version 9B55


(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)


(not in use here)

/usr/bin/git
git version 2.13.6 (Apple Git-96)

Realm framework version: 3.0.2

Xcode version: 9.1

iOS/OSX version: HIGH Sierra 10.13.1

Dependency manager + version: ?

@mitevdev
Copy link
Author

On one side:

Lists can be filtered and sorted with the same predicates as Results.

and

The aggregate expressions @count, @min, @max, @sum and @AvG are supported on List and Results properties

but on the other side:

Note that querying Lists containing primitive values is currently not supported.

This is actually not an issue, primitive types in queries for List are not supported yet.

@bdash
Copy link
Contributor

bdash commented Nov 27, 2017

Support for queries involving arrays of primitives is being tracked at #5334.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants