forked from mongodb/docs-realm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0b7e5f
commit dbbfbe3
Showing
5 changed files
with
97 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
source/examples/generated/kotlin/ReadTest.snippet.kotlin-fts-property.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
class Book() : RealmObject { | ||
class Book : RealmObject { | ||
@PrimaryKey | ||
var _id: ObjectId = ObjectId() // Primary key | ||
|
||
var name: String = "" | ||
|
||
@FullText // Marks the property with FTS | ||
var genre: String = "" | ||
} |
14 changes: 10 additions & 4 deletions
14
source/examples/generated/kotlin/ReadTest.snippet.kotlin-fts-query.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
// Find all the books with science fiction as the genre | ||
var scienceFiction = realmFts.query<Book>("genre TEXT $0", "science fiction").find() | ||
// Find all books with "science fiction" as the genre | ||
val scienceFiction = | ||
realm.query<Book>("genre TEXT $0", "science fiction").find() | ||
|
||
// Find all the books with fiction but not science in the genre | ||
var fictionNotScience = realmFts.query<Book>("genre TEXT $0", "fiction -science").find() | ||
// Find all books with "fiction" but not "science" in the genre | ||
val fictionNotScience = | ||
realm.query<Book>("genre TEXT $0", "fiction -science").find() | ||
|
||
// Find all books with "sci-" and "fi-" prefixes in the genre | ||
val sciFi = | ||
realm.query<Book>("genre TEXT $0", "sci* fi*").find() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters