You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MongoDB Scala Driver is an asynchronous and non blocking driver. Using the Observable model asynchronous events become simple, composable operations, freed from the complexity of nested callbacks.
8
+
@@@
9
+
10
+
See [MongoDB Scala Driver Documentation](http://mongodb.github.io/mongo-scala-driver/2.4/reference/observables/).
11
+
12
+
13
+
## Dealing with Observables
14
+
15
+
### As Future
16
+
17
+
```scala
18
+
19
+
deffindAllRestaurants:Future[Seq[Restaurant]] =
20
+
RestaurantDAO.find().asFuture()
21
+
22
+
```
23
+
24
+
### Result Functions
25
+
26
+
Convert Observable to result object. Import mongo package is needed.
27
+
28
+
Functions headResult anf resultList have an optional maxWait in seconds parameter (Default maxWait = 10 seconds).
0 commit comments