Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. require 'mongo'
  2. class ConnMongo
  3. def connect_mongo
  4. begin
  5. client = Mongo::Client.new(['192.168.1.80:27017'],
  6. database: 'db_logs',
  7. user: 'abusos_conn',
  8. password: '$PassWo3rd_2018')
  9. #result = client[:artists].insert_one( { :name => 'prueba' } )
  10. #result.n
  11. #puts result
  12. rescue Exception => e
  13. puts "Error de conexion..."
  14. end
  15. end
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement