Skip to content

Commit

Permalink
tweak examples some more
Browse files Browse the repository at this point in the history
  • Loading branch information
jillesvangurp committed Dec 24, 2023
1 parent 49106af commit 24360d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ store.update(doc1) {
store.getById(doc1.id)?.let {
println("Retrieved ${it.title}")
}
// delete it
store.delete(doc1)
println("now it's gone ${store.getById(doc1.id)}")

// you can also do bulk inserts using flows or lists
flow {
Expand Down Expand Up @@ -131,10 +134,11 @@ println(
}"
)

// or search on the extracted tag
store.create(MyModel("The quick brown fox"))
// or search on the extracted text
println(
"Found for 'first': ${
store.documentsByRecency(query = "first").first().title
"Found for 'fox': ${
store.documentsByRecency(query = "fox").first().title
}"
)

Expand Down Expand Up @@ -201,10 +205,11 @@ Captured Output:
```
Retrieved Number 1
Retrieved Numero Uno
now it's gone null
five most recent documents: [Bulk 199, Bulk 198, Bulk 197, Bulk 196, Bulk 195]
Total documents: 201
Total documents: 200
Just the bulk tagged documents: 200
Found for 'first': Numero Uno
Found for 'fox': The quick brown fox
Count query total: 201
Both docs exist: 2
in the transaction it exists as: Modified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ val readmeMd = sourceGitRepository.md {
store.getById(doc1.id)?.let {
println("Retrieved ${it.title}")
}
// delete it
store.delete(doc1)
println("now it's gone: ${store.getById(doc1.id)}")

// you can also do bulk inserts using flows or lists
flow {
Expand Down Expand Up @@ -144,10 +147,11 @@ val readmeMd = sourceGitRepository.md {
}"
)

// or search on the extracted tag
store.create(MyModel("The quick brown fox"))
// or search on the extracted text
println(
"Found for 'first': ${
store.documentsByRecency(query = "first").first().title
"Found for 'fox': ${
store.documentsByRecency(query = "fox").first().title
}"
)

Expand Down

0 comments on commit 24360d6

Please sign in to comment.