Hi reactive mongo group!
Using collection.find() on a mongo db view yields the following exception:
13:34:32.388 ERROR[technology-actor-system-akka.actor.default-dispatcher-7] Cursor - fails to send request
reactivemongo.core.errors.DetailedDatabaseException: DatabaseException['Namespace someDb.someView is a view. Legacy find operations are not supported on views. Only clients which support the find command can be used to query views.' (code = 166)]
After enable query logging on the mongo db itself, it prints me:
2017-12-18T16:02:55.234+0000 I QUERY [conn795] assertion CommandNotSupportedOnView: Namespace someDb.someView is a view. Legacy find operations are not supported on views. Only clients which support the find command can be used to query views. ns:someDb.someView query:{ $query: {}, $readPreference: { mode: "primary" } }
Using a different client (pyMongo) the following query is logged:
2017-12-18T15:49:15.701+0000 I COMMAND [conn793] command someDb.someView command: find { find: "someView", filter: {}, $readPreference: { mode: "secondaryPreferred" }, $db: "someDb" } planSummary: COLLSCAN keysExamined:0 docsExamined:292 cursorExhausted:1 numYields:2 nreturned:2 reslen:361886 locks:{ Global: { acquireCount: { r: 18136 } }, Database: { acquireCount: { r: 9068 } }, Collection: { acquireCount: { r: 9067 } } } protocol:op_query 441ms
I am not a mongodb expert, but it seems like there is a legacy command set for mongodb, which is still used in the reactive mongo driver.
Does someone have more insights about this? And there ways to avoid the problem?