Created
June 12, 2018 19:50
-
-
Save jaydestro/84377fbfd29bfe9cab0e1a95526df6f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'mongo' # requires mongoid to be installed | |
Mongo::Logger.logger.level = ::Logger::FATAL # provides logging output for fails | |
client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'hackathon') # establishes database connection to localhost, database name hackathon | |
cursor = client[:products].find | |
cursor.each do |doc| | |
puts doc | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment