Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

word_count example: db.save should be db.save_doc #48

Open
wants to merge 1 commit into from

2 participants

@choxi

CouchRest::Database doesn't have a #save method, I think this should be #save_doc.

@mig-hub

Ah sorry I just made the same pull request.
I fixed delete as well though.
It should be delete_doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2011
  1. @choxi

    save -> save_doc

    choxi authored
This page is out of date. Refresh to see the latest.
View
2  examples/word_count/word_count.rb
@@ -28,7 +28,7 @@
while line = file.gets
lines << line
if lines.length > 10
- db.save({
+ db.save_doc({
:title => title,
:chunk => chunk,
:text => lines.join('')
View
4 examples/word_count/word_count_query.rb
@@ -6,7 +6,7 @@
puts "Now that we've parsed all those books into CouchDB, the queries we can run are incredibly flexible."
puts "\nThe simplest query we can run is the total word count for all words in all documents:"
-puts "this will take a few minutes the first time. if it times out, just rerun this script in a few few minutes."
+puts "this will take a few minutes the first time. if it times out, just rerun this script in a few minutes."
puts db.view('word_count/words').inspect
puts "\nWe can also narrow the query down to just one word, across all documents. Here is the count for 'flight' in all three books:"
@@ -37,4 +37,4 @@
puts
puts 'The url looks like this:'
puts 'http://127.0.0.1:5984/word-count-example/_view/word_count/count?key=["flight","da-vinci"]'
-puts "\nTry dropping that in your browser..."
+puts "\nTry dropping that in your browser..."
View
2  examples/word_count/word_count_views.rb
@@ -18,7 +18,7 @@
db.delete db.get("_design/word_count") rescue nil
-db.save({
+db.save_doc({
"_id" => "_design/word_count",
:views => {
:words => word_count
Something went wrong with that request. Please try again.