简体   繁体   English

使用Casbah Toolkit for MongoDB的Scala Fluid语法

[英]Scala fluid syntax with Casbah toolkit for MongoDB

I am new to Scala and trying to use Casbah toolkit for MongoDb. 我是Scala的新手,并试图将Casbah工具包用于MongoDb。 Casbah tutorial says: Casbah教程说:

"...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:" “ ...这将使Mongo可以使用更流畅的语法。该数据库对象还提供了apply()以获取Collection,因此您可以自由地链接它们:

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") ? 在哪里可以阅读有关mongoClient(“ casbah_test”)(“ test_data”)之类的Scala构造的信息? 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. 关于casbah的文档即将发生动荡,请参阅SCALA-63 ,目前,您希望您掌握如何使用mongodb的实际知识,然后才能掌握如何在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. 就目前而言,我认为最快的成功方法是遵循主要的入门指南,并从Shell中吸取经验教训来学习如何使用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. 如果您更愿意学习代码,则可以使用查询集成规范测试来了解如何使用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 . 如果这样并不能劝阻您,而且您想支持一个开源项目,我会很乐意提出拉要求,以改进文档 -在用户组上给我提供参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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