mongodbscaladaosalat

How to encapsulate SalatMongoCurser in Salat DAO?


Here a solution is explained on how to encapsulate database specific MongoDBObject when making a call to a salat DAO method. Now if I use the find method that returns a SalatMongoCursor, my code will again be dependent on the specific database. I see Here that changing the cursor to a list is bad for performance. Is there a better way out?


Solution

  • Having received no reactions so far to my question, I conclude the answer is "No". Personally, I decided to convert to a List because I will need to traverse it several times later anyway.