Permalink
Browse files

Update to work with Mongo driver 1.0, MM 0.7.5+

  • Loading branch information...
1 parent 381531d commit 690f66206b7fcbdf10da05021be71a0fa81a87f7 @PlasticLizard committed May 3, 2010
Showing with 13 additions and 5 deletions.
  1. +3 −0 CHANGELOG.rdoc
  2. +2 −2 cubicle.gemspec
  3. +8 −3 lib/cubicle/aggregation/aggregation_manager.rb
View
@@ -1,3 +1,6 @@
+==0.1.20
+ *Updated to work with mongo driver 1.0 (and therefore latest versions of MongoMapper)
+
==0.1.19
*Fixed bug that caused cubicle to hang when grouping by days
View
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{cubicle}
- s.version = "0.1.19"
+ s.version = "0.1.20"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nathan Stults"]
- s.date = %q{2010-04-28}
+ s.date = %q{2010-05-03}
s.description = %q{Cubicle provides a dsl and aggregation caching framework for automating the generation, execution and caching of map reduce queries when using MongoDB in Ruby. Cubicle also includes a MongoMapper plugin for quickly performing ad-hoc, multi-level group-by queries against a MongoMapper model.}
s.email = %q{hereiam@sonic.net}
s.extra_rdoc_files = [
@@ -136,9 +136,14 @@ def aggregation_for(query)
def ensure_indexes(collection_name,dimension_names)
col = database[collection_name]
#an index for each dimension
- dimension_names.each {|dim|col.create_index([dim,Mongo::ASCENDING])}
- #and a composite
- col.create_index(dimension_names)
+ dimension_names.each {|dim|col.create_index(dim)}
+ #The below composite isn't working, I think because of too many fields being
+ #indexed. After some thought, I think maybe this is overkill anyway. However,
+ #there should be SOME way to build composite indexes for common queries,
+ #so more thought is needed. Maybe cubicle can compile and analyze query
+ #stats and choose indexes automatically based on usage. For now, however,
+ #I'm just going to turn the thing off.
+ #col.create_index(dimension_names.map{|dim|[dim,1]})
end
def aggregate(query,options={})

0 comments on commit 690f662

Please sign in to comment.