Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'mongo'
- class ConnMongo
- def connect_mongo
- begin
- client = Mongo::Client.new(['192.168.1.80:27017'],
- database: 'db_logs',
- user: 'abusos_conn',
- password: '$PassWo3rd_2018')
- #result = client[:artists].insert_one( { :name => 'prueba' } )
- #result.n
- #puts result
- rescue Exception => e
- puts "Error de conexion..."
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement