8.0/10 (75 أصوات )




  • مرات التنزيل: 274
  • متطلبات التشغيل: Not Application
  • الحجم: 18KB
  • الترخيص: GPL Free
  • الاصدار :
  • اضيف في: 0000-00-00 00:00:00
  • اخر تحديث: 19/01/2011
  • الموقع علي الانترنت:






Description

"Rogue is a type-safe internal Scala DSL for constructing and executing ." BrothersoftEditor: Rogue is a type-safe internal Scala DSL for constructing and executing find and modify commands against MongoDB in the Lift web framework. It is fully expressive with respect to the basic options provided by MongoDB's native query language, but in a type-safe manner, building on the record types specified in your Lift models. An example:Venue where (_.mayor eqs 1234) and (_.categories contains"Thai") fetch(10)The type system enforces the following constraints:the fields must actually belong to the record (e.g., mayor is a field on the Venue record) the field type must match the operand type (e.g., mayor is an IntField) the OperaTor must make sense for the field type (e.g., categories is a MongoListField[String]) In addition, the type system ensures that certain builder methods are only used in certain circumstances. For example, take this more complex query:Venue where (_.closed eqs false) orderAsc(_.popularity) limit(10) modify (_.closed setTo true) updateMultiThis query purportedly finds the 10 least popular open venues and closes them. However, MongoDB does not (currently) allow you to specify limits on modify queries, so Rogue won't let you either. The above will generate a compiler error.Constructions like this:def myMayorships = Venue where (_.mayor eqs 1234) limit(5)...myMayorships.fetch(10)will also not compile, here because a limit is being specified twice. Other Similar constraints are in place to Prevent you from accidentally doing things you don't want to do anyway.More ExamplesQueryTest.scala contains sample Records and examples of every kind of query supported by Rogue. It also indicates what each query translates to in MongoDB's JSON query language. It's a good place to look when getting started using Rogue.NB: The examples in QueryTest only construct query objects; none are actually executed. Once you have a query object, the following operations are supported.





التعليقات علي Rogue
اضافة تعليق

تعليقات الفيسبوك

تعليقات الموقع