@@ -218,26 +218,26 @@ You can build a Atlas Search pipeline stage using search operators.
218
218
.. input::
219
219
:language: kotlin
220
220
221
- val searchStage: Bson = Aggregates.search(
222
- SearchOperator.compound()
223
- .filter(
224
- listOf(
225
- SearchOperator.text(fieldPath("genres"), "Drama"),
226
- SearchOperator.phrase(fieldPath("cast"), "sylvester stallone"),
227
- SearchOperator.numberRange(fieldPath("year")).gtLt(1980, 1989),
228
- SearchOperator.wildcard(fieldPath("title"), "Rocky *")
229
- )
221
+ val searchStage: Bson = Aggregates.search(
222
+ SearchOperator.compound()
223
+ .filter(
224
+ listOf(
225
+ SearchOperator.text(fieldPath("genres"), "Drama"),
226
+ SearchOperator.phrase(fieldPath("cast"), "sylvester stallone"),
227
+ SearchOperator.numberRange(fieldPath("year")).gtLt(1980, 1989),
228
+ SearchOperator.wildcard(fieldPath("title"), "Rocky *")
230
229
)
231
- )
230
+ )
231
+ )
232
232
233
- val projection = Projections.fields(
234
- Projections.include("title", "year", "genres", "cast")
235
- )
233
+ val projection = Projections.fields(
234
+ Projections.include("title", "year", "genres", "cast")
235
+ )
236
236
237
- val aggregatePipelineStages: List<Bson> = listOf(searchStage, Aggregates.project(projection))
238
- val results = collection.aggregate<Document>(aggregatePipelineStages)
239
-
240
- results.forEach { result -> println(result) }
237
+ val aggregatePipelineStages: List<Bson> = listOf(searchStage, Aggregates.project(projection))
238
+ val results = collection.aggregate<Document>(aggregatePipelineStages)
239
+
240
+ results.forEach { result -> println(result) }
241
241
242
242
.. output::
243
243
:language: console
0 commit comments