简体   繁体   中英

Scala fluid syntax with Casbah toolkit for MongoDB

I am new to Scala and trying to use Casbah toolkit for MongoDb. Casbah tutorial says:

"...This should allow a more fluid Syntax to working with Mongo. The DB object also provides an apply() for getting Collections so you can freely chain them:"

scala> val mongoColl = mongoClient("casbah_test")("test_data")
mongoColl: com.mongodb.casbah.MongoCollection = MongoCollection()

Where can I read about Scala constructs such as mongoClient("casbah_test")("test_data") ? Thanks!

I'm sorry its not a great story at the moment and the learning curve is steep. The documentation for casbah is due for an upheaval see SCALA-63 and at the moment it expects you have a working knowledge of how to use mongodb before being able to get to grips with using it in scala.

For the time being I think the fastest way to success is to follow the main getting started guide and take the lessons from the shell into how to use Casbah.

If you are more motivated to dive into the code, you can use the query integration spec tests for an idea how to use the fluid api.

If that doesn't disuade you and you want to support an open source project I'd happily take pull requests on improving the documentation - ping me on the user group .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM