Open CLOVIS-AI opened 1 year ago
Kotlin sequences (https://kotlinlang.org/docs/sequences.html) do not have isEmpty() method but you can write
col.find().evaluate {
println(count() == 0) // prints 'true'
}
HTH
Is it possible to make it clear in evaluate
's documentation?
What would you like to add to the current doc? https://litote.org/kmongo/dokka/kmongo/org.litote.kmongo/com.mongodb.client.-mongo-iterable/evaluate.html
“Evaluates the current MongoIterable given the expression of Sequences, including when it is empty.” or similar.
At least this way it's clear that it's an intended behavior and it won't go away in the future.
What does
evaluate
do when no results are found?Ideally, I'd like it to call the lambda with an empty sequence:
In case this is the current behavior, would it be possible to add a sentence to make it clear in
evaluate
's documentation?