Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ class EqualsSearchOperatorDsl {
document["value"] = value
}

/**
* Value to query for string, indexed as MongoDB Search token type.
*
* @param value Value must be a string.
*/
fun value(value: String) {
document["value"] = value
}

/**
* The score assigned to matching search term results. Use one of the following options to modify the score:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,27 @@ internal class EqualsSearchOperatorDslTest : FreeSpec({
""".trimIndent(),
)
}

"should build a value by String" {
// given
val operator = equal {
value("stringValue")
}

// when
val result = operator.build()

// then
result.shouldBeJson(
"""
{
"equals": {
"value": "stringValue"
}
}
""".trimIndent(),
)
}
}

"score" - {
Expand Down
Loading