collQueries.createIndex(Document("name" -> 1, "unique" -> true))
collQueries.createIndex(Document("name" -> 1, "unique" -> true), IndexOptions())
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/f7b692b2-b656-482d-a9c4-c223757a9306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
collQueries.createIndex(Document("name" -> 1), IndexOptions().unique(true))Hi Raman,
The MongoDB Scala Driver uses the Observable model. All Observables returned from the API are cold, meaning that no I/O happens until they are subscribe to.
For example, you can use toFuture():scala.concurrent.Future[Seq[T]]) which automatically subscribes to the Observable and uses the collect:org.mongodb.scala.Observable[Seq[T]]) method to aggregate the results.
collection.createIndex(Document("user" -> 1), IndexOptions().unique(true)).toFuture()
Also have a look at some helper methods defined in Helpers.scala to get and print results. For example, using the results() blocks until the Observable is completed and returns the collected results
// Returns: { "v" : 1, "unique" : true, "key" : { "name" : 1 }, "name" : "name_1", "ns" : "mydb.test" }
collection.createIndex(Document("name" -> 1), IndexOptions().unique(true)).results()
Check out the Quick Tour Primer for more information on the Observable API.
Regards,
Wan.