Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. mongodb://<user>:<password>@staff.mongohq.com:10022/testdb
  2.  
  3. my $connection = MongoDB::Connection->new(host => 'localhost', port => 27017);
  4. my $database = $connection->foo;
  5.  
  6. my $connection = MongoDB::Connection->new(host => 'mongodb://staff.mongohq.com:10022', username => 'dbuser', password => 'dbpass', db_name => 'testdb');
  7. my $database = $connection->testdb;
  8.  
  9. use MongoDB;
  10. use MongoDB::OID;
  11.  
  12. my $conn = MongoDB::Connection->new(
  13. host => 'remote server's inet address or host name',
  14. port => 27017,
  15. username=>'your_user_name',
  16. password => 'your_password',
  17. db_name => 'your_db_name'
  18. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement