-
-
Save avsej/3621659 to your computer and use it in GitHub Desktop.
Couchbase Ruby Client Library Doc Insert and View Query
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
new_beer = {"name" => "Atlantic Amber"} | |
client.add("beer_Atlantic_Amber", new_beer) | |
view = client.design_docs["beers"].by_name(:key => "Atlantic Amber", :limit => 1) | |
view.each do |beer| | |
puts beer["name"] | |
end | |
# or | |
view = client.design_docs["beers"].by_name | |
view.each(:key => "Atlantic Amber", :limit => 1) do |beer| | |
puts beer["name"] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment