Ok this is the actual inital code... need to convert from mongo to sqlite...
This commit is contained in:
parent
8c856ce465
commit
8fa1664bcb
13 changed files with 1168 additions and 0 deletions
23
mongo_connect.rb
Normal file
23
mongo_connect.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#require 'rubygems' # not necessary for Ruby 1.9
|
||||
require 'mongo'
|
||||
|
||||
Mongo::Logger.logger.level = ::Logger::FATAL
|
||||
|
||||
include Mongo
|
||||
|
||||
class MongoConnect
|
||||
def initialize(dbname, collname)
|
||||
@db = Mongo::Client.new(
|
||||
["127.0.0.1:27017"],
|
||||
:database => dbname)
|
||||
@coll = @db[collname.to_sym]
|
||||
end
|
||||
|
||||
def db()
|
||||
return @db
|
||||
end
|
||||
|
||||
def collection()
|
||||
return @coll
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue