File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
driver/src/main/scala/org/reactivecouchbase/client Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class QueryEnumerator[T](futureEnumerator: () => Future[Enumerator[T]]) {
69
69
def toEnumerator : Future [Enumerator [T ]] = futureEnumerator()
70
70
71
71
/**
72
- *
72
+ *
73
73
* @param ec ExecutionContext for async processing
74
74
* @return the query result as enumerator
75
75
*/
@@ -86,7 +86,7 @@ class QueryEnumerator[T](futureEnumerator: () => Future[Enumerator[T]]) {
86
86
futureEnumerator().flatMap(_(Iteratee .getChunks[T ]).flatMap(_.run))
87
87
88
88
/**
89
- *
89
+ *
90
90
* @param ec ExecutionContext for async processing
91
91
* @return the optinal head
92
92
*/
@@ -222,10 +222,12 @@ trait Queries {
222
222
QueryEnumerator (() => rawSearch(view)(query)(bucket, ec).toEnumerator.map { enumerator =>
223
223
enumerator &>
224
224
Enumeratee .map[RawRow ] { row =>
225
- row.document.map { doc =>
226
- if (doc != null )
227
- JsRow [T ](r.reads(Json .parse(doc)), row.id, row.key, row.value)
228
- else null
225
+ row.document.flatMap { doc =>
226
+ if (doc != null ) {
227
+ Some (JsRow [T ](r.reads(Json .parse(doc)), row.id, row.key, row.value))
228
+ } else {
229
+ None
230
+ }
229
231
}.getOrElse(
230
232
JsRow [T ](JsError (), row.id, row.key, row.value)
231
233
)
You can’t perform that action at this time.
0 commit comments