@@ -43,7 +43,7 @@ import akka.stream.ActorMaterializer
43
43
import com .typesafe .config .ConfigFactory
44
44
import org .reactivecouchbase .rs .scaladsl .{N1qlQuery , ReactiveCouchbase }
45
45
import org .reactivecouchbase .rs .scaladsl .json ._
46
- import play .api .libs .json .Json
46
+ import play .api .libs .json ._
47
47
import akka .stream .scaladsl .Sink
48
48
import akka .actor .ActorSystem
49
49
import akka .stream .ActorMaterializer
@@ -69,13 +69,13 @@ object ReactiveCouchbaseTest extends App {
69
69
val bucket = driver.bucket(" default" )
70
70
71
71
val future = for {
72
- _ <- bucket.insert(" key1" ,
72
+ _ <- bucket.insert[ JsValue ] (" key1" ,
73
73
Json .obj(" message" -> " Hello World" , " type" -> " doc" ))
74
74
doc <- bucket.get(" key1" )
75
75
exists <- bucket.exists(" key1" )
76
76
docs <- bucket.search(
77
77
N1qlQuery (" select message from default where type = $type" )
78
- .on(Json .obj(" type" -> " doc" )))
78
+ .on(Json .obj(" type" -> " doc" )).asQueryParams )
79
79
.asSeq
80
80
messages <- bucket.search(
81
81
N1qlQuery (" select message from default where type = 'doc'" ))
@@ -138,7 +138,7 @@ class ApiController @Inject()(couchbase: Couchbase)
138
138
.search(N1qlQuery (
139
139
" select id, payload, date, params, type from events where type = $type"
140
140
)
141
- .on(Json .obj(" type" -> filter.getOrElse(" doc" )))
141
+ .on(Json .obj(" type" -> filter.getOrElse(" doc" )).asQueryParams )
142
142
.asSource
143
143
.map(Json .stringify)
144
144
.intersperse(" [" , " ," , " ]" )
0 commit comments