reactivemongo 0.11.11 DefaultIndexesManager - db: DB with DBMetaCommands

14 views
Skip to first unread message

Ugo Bourdon

unread,
Apr 11, 2016, 10:41:56 AM4/11/16
to ReactiveMongo - http://reactivemongo.org
Hi,

I upgrade my reactivemongo driver to 0.11.11 and when I try to create IndexesManager :
private lazy val indexer = new DefaultIndexesManager(db)

I have compile error

type mismatch;
[error]  found   : reactivemongo.api.DB
[error]  required: reactivemongo.api.DB with reactivemongo.api.DBMetaCommands
[error]     private lazy val indexer = new DefaultIndexesManager(db)

Have any example or tips to create db with this DBMetaCommands.

For info, I use play reactivemongo module to start my connection

lazy val reactiveMongoApi = current.injector.instanceOf[ReactiveMongoApi]

Thx for your response.

Cédric Chantepie

unread,
Apr 11, 2016, 11:41:14 AM4/11/16
to ReactiveMongo - http://reactivemongo.org
The member .database of ReactiveMongoApi returns a Future[DefaultDB], and DefaultDB extends DB with DBMetadataCommands.

Ugo Bourdon

unread,
Apr 11, 2016, 12:29:04 PM4/11/16
to ReactiveMongo - http://reactivemongo.org
Thx. Even ReactiveMongoApi.db return DefaultDB, but I cast it in DB.

Thx for answer.

Cédric Chantepie

unread,
Apr 11, 2016, 12:49:55 PM4/11/16
to ReactiveMongo - http://reactivemongo.org
You use .database instead of .db , to have the new DB resolution.

Ugo Bourdon

unread,
Apr 12, 2016, 4:57:16 AM4/12/16
to ReactiveMongo - http://reactivemongo.org
Ok.
Reply all
Reply to author
Forward
0 new messages