Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ Balint Erdi | |
David Lee | ||
Frederick Cheung | ||
James Rosen | ||
Karel Minarik | ||
Niket Patel | ||
Paul Carey | ||
Priit Tamboom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
h3. RelaxDB 0.4 | ||
|
||
RelaxDB 0.4 contains a number of breaking changes. However, most clients should be able to upgrade smoothly. | ||
|
||
h4. Views | ||
|
||
The largest change concerns automatic view generation. Prior to 0.4 an invocation of `view_by :foo` would create a JavaScript view in CouchDB of the form `emit(doc.foo, doc);`. This idiom is generally advised against. It makes view generation comparatively slow, and in particular, causes performance issues for large databases. In 0.4 `view_by :foo` now creates a map of the form `emit(doc.foo, 1);` and creates a reduce using the `_sum` builtin. | ||
|
||
If view size isn't an issue for you, legacy behaviour can be preserved by replacing all invocations of `view_by` with `view_docs_by`. Similarly, any invocations of `RelaxDB.view` against auto-generated views should be replaced with `RelaxDB.docs`. | ||
|
||
Note that `view_by` invocations no longer add paginate methods to the current class. Paginating over these views should be done with one of `RelaxDB.paginate` or `RelaxDB.qpaginate`. | ||
|
||
h4. View Uploading | ||
|
||
The standard idiom for saving autogenerated views is now | ||
|
||
<pre> | ||
<code> | ||
RelaxDB.enable_view_creation | ||
require File.dirname(__FILE__) + '/spec_models.rb' | ||
RelaxDB::View.design_doc.save | ||
</code> | ||
</pre> | ||
|
||
The explicit call to `.save` is new in 0.4. It was added to enable creating all views in a single request, rather than requiring a request per view. | ||
|
||
h4. Pagination | ||
|
||
The standard paginate method makes three requests against CouchDB. One to retrieve the docs and a further two to determine if next and prev links should exist. In some instances it may be preferable to save two requests and present potentially spurious pagination links. The qpaginate method does just this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters