I'm using Casbah and Salat to create my own Mongodb dao and am implementing a getAll method like this:
val dao: SalatDAO[T, ObjectId]
def getAll(): List[T] = dao.find(ref = MongoDBObject()).toList
What I want to know is:
- Is there a better way to retrieve all objects?
- When I iterate through the objects, I can't find the object's _id. Is it excluded? How do I include it in the list?