Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 231 commits
  • 58 files changed
  • 16 contributors
May 18, 2010
John Nunemaker Symbol operators now are equality and comparable aware. 1bde2f6
John Nunemaker Ruby 1.9 encoding comments. 1b8c58d
May 19, 2010
John Nunemaker Update to latest driver and fix OrderedHash test issue. 44a1aa0
John Nunemaker Release 0.1.2.
* Update driver to latest
* SymbolOperator equal/compare
* Ruby 1.9 encoding comments
May 21, 2010
John Nunemaker Added prettier inspecting of queryies since Mongo::Collections have a…
… crap ton of data in them.
John Nunemaker Simplify Query#all. 8fecd98
John Nunemaker Fixed test order issue in 1.9. 2b4106b
John Nunemaker Do nothing if no sort provided. 1a320fc
John Nunemaker Added CriteriaHash#simple? and delegated Query#simple? to criteria. cf582e7
John Nunemaker Added OptionsHash#fields? to return true/false if we are selecting fi…
…elds. Delegated Query#fields? to options hash.
May 23, 2010
John Nunemaker Added initialize_copy to OptionsHash, CriteriaHash, and Query which m…
…akes clone/dup work correctly. Merged queries no longer share the same referenced options/criteria.
John Nunemaker Minor: removing commented out code. d87c1d0
John Nunemaker Release 0.1.3.
* Added initialize_copy to OptionsHash, CriteriaHash, Query so they clone/dup properly
* Simplified Query#all
* Added CriteriaHash#simple?
* Added OptionsHash#fields? to return true/false based on whether fields have been selected
* Prettier inspecting of Query
May 25, 2010
John Nunemaker Remove rubygems version requirement. Shouldn't really matter at all. …
…Might as well be more liberal.
John Nunemaker More liberal mongo requirement. We'll see how this goes. 12342d1
John Nunemaker Added versions to the dev deps. 282c4b0
John Nunemaker Release 0.1.4. More liberal dependencies and requirements. 8ff4c8b
May 28, 2010
John Nunemaker Added pagination. 0c6a4cd
John Nunemaker Added an extra assertion just to make sure that things are working. b19bfa5
John Nunemaker Rename find to find_many. Going to add find which works similar to AR…
… and MM.
John Nunemaker Also dropping indexes when clearing collections just to be sure. cfcb5a9
John Nunemaker Minor: Test helper update. File.expand_path is more simple. b20a9f5
John Nunemaker Query#paginate now takes options and does not modify the query object. 8ff564f
John Nunemaker Added CriteriaHash#merge! and dup'ing arrays and hash values in initi…
John Nunemaker Added OptionsHash##merge and #merge! and dup'ing arrays and hash valu…
…es in initialize_copy.
John Nunemaker All the methods that actually perform queries no longer update the op…
…tions of the original query. Makes more sense this way.
John Nunemaker Added Query#find which finds documents by their id(s). 6606fd6
May 29, 2010
John Nunemaker Pagination is now passing criteria to count when getting total entries. a8ea631
May 30, 2010
John Nunemaker Release 0.2.
* Added Query#paginate which returns decorated array ready to use with will paginate, etc.
* Changed Query#find to find_many.
* Original query object never gets modified anymore. Now they all clone and update.
* Added Query#find to find by ids.
John Nunemaker Ruby 1.9 considers *nil to be [] whereas 1.8 does [nil]. Odd. 53d8abe
John Nunemaker Release 0.2.1. e00423d
May 31, 2010
John Nunemaker Instead of checking array/hash in initialize_copy I'm going the rails…
… route of defining what is duplicable? and cloning if true.
Jun 03, 2010
John Nunemaker Readme update. 8582416
Jun 04, 2010
John Nunemaker Minor: Order was causing failure. aaa5cad
John Nunemaker Moved symbol extensions to file. d3cc016
John Nunemaker Explicitly define all the symbol methods and include them so there is…
… a trail to follow for runtime spelunkers.
Jun 15, 2010
John Nunemaker Added size which works like count without options. 5c64fda
John Nunemaker Added Query#empty? which returns true or false depending on if any do…
…cuments are found for query.
John Nunemaker Added Query#to_a which just calls all to return array of matching doc…
John Nunemaker Delegate each to to_a and include Enumerable. 4263b4d
John Nunemaker Minor: spacing in Query. 9aa4e11
John Nunemaker Renamed find_many to find_each. a85df4f
John Nunemaker Release 0.3.0. 4bced88
Jun 17, 2010
John Nunemaker Added exists?. d10fc61
John Nunemaker Alias exist to exists. 2e0927f
John Nunemaker Delegate #include? to #to_a. 525daf3
John Nunemaker Release 0.3.1. 448f2dc
Jun 18, 2010
John Nunemaker Straightening up test dependencies and moving things around in prepar…
…ation for better test running.
John Nunemaker Forgot to splat the args to fields so hash arg came in as array with …
…one hash which meant you could not negate fields.
John Nunemaker Aliased order to sort. 9b2665e
John Nunemaker Aliased offset to skip. 395bec7
John Nunemaker Release 0.3.2. Aliased offset/order to skip/sort and fixed fields wit…
…h hash bug.
Aug 09, 2010
John Nunemaker Version bump. 0f9071c
Aug 10, 2010
Scott Watermasysk Added ignore and only to the main query class.
This will allow you to chain together including or excluding fields without having to understand the MongoDB internals around the :fields hash.

Richard Livsey don't change $or query values to $in hash 35699ac
Aug 11, 2010
John Nunemaker 1.9 fix with fields. 9f959c8
John Nunemaker Update mongo version. d2fd064
John Nunemaker Add log buddy into the test mix for debugging. 5038058
John Nunemaker Added Query#explain. 43ae28c
John Nunemaker Release 0.3.4.
* 1.9 fields with hash fix.
* Update mongo version.
* Added Query#explain.
Aug 29, 2010
John Nunemaker Updated to latest mongo gem and fixed BSON::ObjectId deprecations. e2cb67f
John Nunemaker Updated shoulda. c88f2d0
John Nunemaker Added symbol descending test in query. 16ac059
John Nunemaker 0.3.5 release.
* mongo gem update
* update BSON::ObjectID deprecation to BSON::ObjectId
Oct 11, 2010
John Nunemaker Updated mongo dependency. 8f4fb5e
John Nunemaker Bump 0.3.6 for new mongo dependency. 8761e3c
Nov 05, 2010
Michael Parrish Resolves "SecurityError: can't modify literal regexp" exceptions when…
… using regex in a where query
Feb 07, 2011
John Nunemaker Made plucky only convert object ids if actually possible. 5c0937d
Feb 18, 2011
Norbert Crombach Add Query#distinct method e9e35f0
Feb 27, 2011
John Nunemaker Bump version for release. c956a32
Mar 18, 2011
John Nunemaker Switch to bundler for development dependencies and updated mongo ruby…
… driver to ~> 1.2.4.
John Nunemaker Added MongoVersion constant to share between mongo and bson_ext depen…
John Nunemaker Use bundler for release rake tasks. 2dce8c7
John Nunemaker Merge branch 'master' of into norbe…
John Nunemaker Removed Gemfile.lock from repo. 7470be0
John Nunemaker Whitespace. Formatting. Non-destructive :sort. 810ad61
Mar 26, 2011
John Nunemaker Changed test database name. c3bb023
Apr 15, 2011
John Nunemaker Simplified explain check so it is less brittle. This is enough to get…
… the point across.
John Nunemaker Bump mongo dependency. aacf0f5
John Nunemaker Added tests for transforming documents. d926698
John Nunemaker Version to 0.3.8. 412cdeb
Apr 23, 2011
John Nunemaker Optimize each and to_a to use find_each instead of all.
all loads every doc into memory, find_each creates a cursor and loads as you keep reqeusting.
John Nunemaker Changing Query#update to #amend.
Update is a term actually used by mongo that I would like to support in plucky. This breaks backwards compatibility so I'll bump version accordingly on next release.
John Nunemaker Formatting... 42016ac
John Nunemaker Aliased where to filter. 1966cba
John Nunemaker Releasing 0.4.0. 246e592
John Nunemaker Added upgrades for for backwards incompat changes. fb28c1b
Apr 26, 2011
John Nunemaker Add tests back to packaged files and UPGRADES file. I find these usef…
…ul personally.
May 28, 2011
John Nunemaker Update to latest mongo driver. 6e56618
John Nunemaker Check if already bson object id first. Assumes that is most common. 966abc9
John Nunemaker Added array of methods that perform queries. e199b33
John Nunemaker Added new relic instrumentation file that can be required. 680cf2f
John Nunemaker Added ability to pass driver options to #remove. f1c2f52
John Nunemaker Added #update method. 92e9210
John Nunemaker Added new find options. 5e82c6d
John Nunemaker Releasing 0.4.1. 4bb3f69
Jul 19, 2011
Scott Gonyea Removed autoloading. This makes Plucky thread safe. It also makes the…
… code uglier. Apologies.
Scott Gonyea Autoloading version is cool, actually. 8820e24
Jul 20, 2011
Brandon Keepers Merge pull request #11 from sgonyea/master
Removed autoloading. This makes Plucky thread safe. It also makes the code uglier. Apologies.
Aug 18, 2011
Jonathan Chambers added support for new $and operator by preventing wrapping with $in 85f5a6b
John Nunemaker Merge pull request #14 from jmchambers/master
added support for new $and operator by preventing wrapping with $in
John Nunemaker Separate $or and $and tests. 8b52b96
Aug 23, 2011
Joel Junström Added failing test for comparing symbol operator with an instance of …
…another class
Joel Junström Make SymbolOperator check other.class before comparing method values f71d298
Sep 13, 2011
Brandon Keepers Merge pull request #16 from Oktavilla/symbol-operator-comparability
Symbol operator comparability
Oct 08, 2011
John Nunemaker Updating mongo dependency to support 1.4.x. 2feaac9
John Nunemaker Release 0.4.2. e39f101
Nov 03, 2011
Brandon Keepers Relax version requirement on mongo driver so it works with 1.4 31e18aa
Nov 07, 2011
Brandon Keepers Release 0.4.3. f8f18ee
Jan 20, 2012
John Nunemaker Update mongo dependency. fb3782e
John Nunemaker Bump version. 0.4.4
* updated mongo version
Mar 04, 2012
Brian Hempel Support $nor operator for completeness [Fixes #19] ea125ac
Brian Hempel Fix tests on Ruby 1.8.7 [Fixes #18] 800b5a6
Brian Hempel Allow symbol operators in $or, $and, and $nor clauses [Fixes #12] 84bd0e1
Mar 12, 2012
Brian Hempel Merge pull request #20 from brianhempel/allow_symbol_operators_in_nes…

Allow symbol operators in nested expressions [Fixes #12, #19, #18]
Brian Hempel Pass CriteriaHash options along when resolving nested queries afdfd79
Mar 19, 2012
Brian Hempel Query#find_each yields docs to a block if given [Fixes #21 and mongom… d12d822
Mar 30, 2012
Brian Hempel Query#each forwards to #find_each (so it will return an enumerator) 3378014
Brian Hempel Update Plucky::Methods (add :reverse, :per_page, :find_one, :find) b782ec7
Apr 17, 2012
Brian Hempel Move all methods to delegate into Plucky::Query::DSL and populate Plu…
…cky::Methods from its instance_methods
Apr 20, 2012
John Nunemaker Ensure that plucky is not destructive with array of id inputs.
Fixes #15
John Nunemaker Added travis and tweaked gemfile. 9d538b7
John Nunemaker Use Bundler.require in test helper. a45339e
John Nunemaker Merge branch 'non-destructive-normalize-value' fc1733c
John Nunemaker Release 0.5.0. 93e20f7
John Nunemaker Switch to markdown. 1500620
John Nunemaker Add example 628f7d3
John Nunemaker Run example when changed 716de43
John Nunemaker Beef up readme. ff64788
John Nunemaker Fix readme ca731fb
John Nunemaker Add homepage to gemspec and update file manifests to use git 7c7a7dd
Apr 21, 2012
Brian Hempel Unbreak MongoMapper (87 failures). I translated the code wrong in 84b… 010fef5
Apr 24, 2012
John Nunemaker Release 0.5.1 abb4543
May 23, 2012
Fix merge of nested criterias like c13ab1f
Sep 12, 2012
John Nunemaker Kill growl stuff 9b6a200
John Nunemaker Ensure that count always uses a cursor and only does a count.
There are instances where MongoMapper loads every document in a cursor,
so using find_each caused every document that was counted to also be
loaded as an object.
John Nunemaker Release 0.5.2. 60f18d6
Oct 09, 2012
John Nunemaker Add mongo service for travis. a3df7b1
John Nunemaker Use Hash#fetch instead of setting default.
Hash constant with default is stupid and not thread safe.

Closes #24
John Nunemaker Merge pull request #23 from divoxx/fix_merge_nested_crits_like_elemmatch
Fix merge of nested criterias like
John Nunemaker Switch to rspec. ce34872
John Nunemaker Added guard. 0d9ce71
John Nunemaker Tweak spec helper to allow easy focusing. fd0661e
John Nunemaker Merge branch 'master' of
John Nunemaker Fix failing spec. e958223
John Nunemaker Ignore bin and vendor. 2445f00
John Nunemaker Bundle config. a917bb6
John Nunemaker Formatting and naming. 8388a5b
John Nunemaker Formatting and other minor tweaks.
No changed functionality, just trying to clean things up a bit.
Oct 10, 2012
John Nunemaker Move normalized keys to top of class 71317e8
John Nunemaker Explaining method for normalizing limit/skip integers. ba68a0d
John Nunemaker Make option keys a set. 873619d
John Nunemaker Move key normalization to method. dcc2f47
John Nunemaker Faster CriteriaHash#simple?
Was creating 3 sets for each simple? check. Now shortcuiting if key
size is too great or using sort to do comparision against constants.
Fewer objects and sort is faster than set. Also increased test coverage.
John Nunemaker Move nesting operator to method.
Also doc'd the nesting operator constant.
John Nunemaker Minor: formatting. e8ab804
John Nunemaker Better parameter name 03a1a7d
John Nunemaker Update mongo find options. f53e52a
John Nunemaker Rename parameter.
original is more revealing than source.
John Nunemaker Some query cleanup.
* added Query#cursor which returns Mongo::Cursor with query's criteria
and options applied.
* added Query#criteria_hash and Query#options_hash which call to_hash
on related source hash
* added hash_for_key to determine which hash should be used based on
the key provided
John Nunemaker Ruby 1.8 doesn't like sorting symbols
Switching back to set comparison rather than changing symbols to string
before sort.
John Nunemaker Drop support for 1.9.2 c4f8dba
Oct 11, 2012
John Nunemaker Move criteria hash value normalization to separate class.
Also allowing it to be injected so it can be changed at runtime.
John Nunemaker Move criteria hash key normilization to separate class.
Also made it injectable.
John Nunemaker Return value in docs for criteria hash value normilizer. 56a3e55
John Nunemaker Beef up tests for CriteriaHash#[]= d1ac9bf
John Nunemaker Added Plucky.modifier? 92bda90
John Nunemaker Duplicate spec. 7823894
John Nunemaker Use symbols everywhere for modifiers.
Doing this exposed an issue where modifiers were being doubled up in
nesting. Fixed that as well.
John Nunemaker Spec for merge! returning self. f3b4d2d
John Nunemaker Check exact source instead of object equality
Ran into issue previously where object was initializing with wrong
source. This makes sure that source is what we expect and that object
initialization isn't screwing anything up and hiding it.
John Nunemaker Fix for ruby 1.8.x 24a6b56
John Nunemaker Remove duplication of modifier checking.
My goodness I hate that merge method. It must die...
John Nunemaker Move options hash key normalization to separate file. dc8d681
John Nunemaker Move options hash value normalization to multiple files
Each piece is customizable now and definitely getting more clear.
Slowly but surely.
John Nunemaker Change key error to argument error.
Ruby 1.8 and 1.9 raise different errors for key missing when using
John Nunemaker Added spec for sort value required keys da19e2f
John Nunemaker Change #normalize_key to #symbolize_key in query b34ffdf
John Nunemaker Rename source to original d32960c
John Nunemaker Explicit > method missing for criteria hash
Also used instance variables where possible instead of methods.
John Nunemaker Explicit > method missing for options hash 2de7de3
John Nunemaker Original instead of source 3a83784
John Nunemaker Use instance variables instead of methods 204e49a
John Nunemaker Instance variables over methods in query f38802d
John Nunemaker A bunch of docs. a1bf098
Oct 12, 2012
John Nunemaker Only drop indexes before the entire suite ab3af29
John Nunemaker Switch to bson ordered hash shortcut syntax from helper 9441cd2
John Nunemaker Missed a few bson ordered hashes d63cf95
Oct 13, 2012
John Nunemaker Added performance group to gemfile. Bundle without it for travis. a4c563a
John Nunemaker Added sample perftools script. 4bed082
Oct 19, 2012
Chris Heald Remove extraneous &block binding, remove extraneous method calls via …
…method aliasing, fix Query#all to collect documents as it iterates them, rather than invoking to_a on the cursor post-iteration
Oct 22, 2012
Chris Heald Change #exists? to use a single-record lookup rather than count, whic…
…h must do a full collection scan
Chris Heald #reverse will sort by _id descending if no sort is specified. Provide…
…s functionality parity with AR.
Nov 12, 2012
Winfield Fix exists?() performance using find_one().
Use find_one() instead of count(), since it's faster on most datastores for large collections. Especially MongoDB, where count() can't use indexes properly.
Dec 28, 2012
John Nunemaker Fix write concern for mongo 1.8 in spec. dfef662
John Nunemaker Update readme and query for new mongo client. f9cb741
John Nunemaker Release 0.6.0. 09c9330
Dec 30, 2012
do not normalize to $in operator with an empty array 139cc46
Dec 31, 2012
John Nunemaker Merge pull request #26 from wpeterson/perf/exists
Fix exists?() performance using find_one().
John Nunemaker Merge branch 'master' of into cheald…
John Nunemaker Use only instead of fields in #exists?. f408537
John Nunemaker Merge branch 'master' of
John Nunemaker Releasing 0.6.1. ae75e52
John Nunemaker Fix merging two bson object ids into an array.
Refs #28
John Nunemaker Correctly merge array of object ids and object id and vice versa.
Closes #28
John Nunemaker Merge pull request #30 from jnunemaker/fix-bson-id-merging
Fix bson id merging
John Nunemaker Merge pull request #29 from paulwalker/empty_array_crit_value_fix
do not normalize to $in operator with an empty array
John Nunemaker Release 0.6.2.
* do not normalize empty array to $in
* correctly handle merging of bson object ids in criteria
Jan 14, 2013
Kyle VanderBeek Allow a paginate query to override the total_entries value, enabling …
…API consumers to potentially cache expensive counting operations.
Jan 15, 2013
John Nunemaker Merge pull request #31 from kylev/total_entries
Allow a paginate query to override the total_entries
Mar 14, 2013
John Nunemaker Remove bundle config from repo. 1b1d61d
John Nunemaker Change rubygems source in gemfile. 2198708
John Nunemaker Kill ruby debug. Always causes bundler issues. 7f49ca2
John Nunemaker Use mongo client and don't attempt to fudge with system collections. 3ba426f
John Nunemaker No need for terminal notifier. 1476139
John Nunemaker Release 0.6.3. 6fd55a6
Apr 24, 2013
Bjorn Blomqvist ruby hash comparison starts with comparing hash values 208c7c9
Bjorn Blomqvist ruby hash comparison uses #eql? for equality check b8e4f43
Apr 30, 2013
John Nunemaker Merge pull request #32 from bjornblomqvist/rspec_query_equality_fix
Rspec query equality fix
Jun 22, 2013
Chris Heald Replace the pagination decorator with a pagination collection to elim…
…inate the runtime #extend, so that we aren't constantly nuking the Ruby method cache.
Jun 26, 2013
John Nunemaker Merge pull request #34 from cheald/master
Replace the pagination decorator with a pagination collection to eliminate the runtime #extend, so that we aren't constantly nuking the Ruby method cache.
Jul 03, 2013
John Nunemaker Added handy scripts and optionally used gh mongodb port if available. 0e257fb
John Nunemaker Allow performing query with no timeout.
Fixes #33.
John Nunemaker Release 0.6.4. 06fef9c
John Nunemaker Use boxen port over gh port. 2615e5a
Jul 07, 2013
Chris Heald Refactor key normalizer to accept an initial hash of values to transl…
…ate. Separate translation keys for Options and Sort, so that sort keys don't get erroneously translated.
Chris Heald Rewrite CriteriaHash#merge to be less gnarly. Add $or merging.
This add collapsing of multiple $ors or $ors + $ands containing $ors into a compound $and statement.

* Closes mongomapper/mongomapper#298
* Closes mongomapper/mongomapper#499
Jul 08, 2013
John Nunemaker Merge pull request #36 from cheald/master
Fix issues with OptionsKeyNormalizer acting on sort fields
John Nunemaker Merge pull request #37 from cheald/compound_or
Rewrite CriteriaHash#merge to be less gnarly. Add $or merging.
John Nunemaker Release 0.6.5. 7147e5c
Jul 11, 2013
Chris Heald Fix sort key mappings. Closes #38. ba4e60e