2015-10-29 6 views
-1

Я работаю с "org.reactivemongo" %% "play2-reactivemongo" % "0.11.7.play24" и когда я скомпилировать мой proyect, покажите мне следующие ошибки:метод курсора в черта GenericQueryBuilder осуждается

[error] /home/hector/enova/play-silhouette-reactivemongo-seed-master/app/controllers/CourseController.scala:90: method cursor in trait GenericQueryBuilder is deprecated: Use [[cursor]] function with read preference. 
[error]  cursor[JsObject] 
[error]  ^
[error] /home/hector/enova/play-silhouette-reactivemongo-seed-master/app/controllers/CourseController.scala:120: method cursor in trait GenericQueryBuilder is deprecated: Use [[cursor]] function with read preference. 
[error]  cursor[JsObject] 
[error]  ^
[error] two errors found 
[error] (compile:compileIncremental) Compilation failed 

линий 90 и 120 выделены жирным шрифтом:

val cursor: Cursor[JsObject] = collection. 
     find(Json.obj("title" -> title)). 
     sort(Json.obj("created" -> -1)).  
     cursor[JsObject] 


    val cursor: Cursor[JsObject] = collection. 
     find(Json.obj("active" -> true)). 
     cursor[JsObject] 

Как я могу это исправить?

ответ

1

Просто добавьте круглые скобки к методу cursor. Это будет работа.

collection.find(...).cursor[JsObject]()