-1

I'm working with "org.reactivemongo" %% "play2-reactivemongo" % "0.11.7.play24" and when i compile my proyect, show me the next errors:

[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

The lines 90 and 120 are are in bold:

    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]

How can i fix this?

cchantep
  • 9,118
  • 3
  • 30
  • 41
Sanx
  • 223
  • 1
  • 6
  • 17

1 Answers1

1

Just add parentheses to cursor method. This will be work.

collection.find(...).cursor[JsObject]()
MrRontgen
  • 132
  • 1
  • 6