From(collection) .where("item.some_boolean or (item.other_boolean and item.another_boolean)") .order_by("item.some_order_property") .select("name","age","sex","salary") # This query returns a new collection transformed from the original. # The items in this new collection are from a class called # Dynamic_Item and feature only the four selected properties, # instead of all the properties of the original items in 'collection'. # The where clause is observed as well, since only the items that # the given clause evaluates to true are returned.