I have a code like this:
def getItems(): Future[List[Item]] =
collection.find(BSONDocument.empty).cursor[Item]().
collect[List](-1, Cursor.FailOnError[List[Item]]())
But it is not getting all the items in the collection. When I look in the shell I can see the item by doing this:
db.items.find({});
I also tried to swap Json.obj with BSONDocument.empty but it doesn't bring back the item in the collection.
I also tried to do this to see if the cursor code is wrong. I tried something simple:
override def getItems(): Future[Item] =
collection.find(Json.obj()).requireOne[Item]
This does not work either.
What I am doing wrong?