- 论坛徽章:
- 0
|
在测试使用perl连接mongodb的时候测试最简单的例子:
#!/usr/bin/perl -w
use MongoDB;
use Data: umper;
my $connection = MongoDB::Connection->new(host => 'localhost', port => 1105);
my $database = $connection->test;
my $collection = $database->foo;
my $id = $collection->insert({ some => 'data' });
my $data = $collection->find_one();
print Dumper($data);
执行后返回结果是:
Can't locate object method "run_command" via package "MongoDB: atabase" at /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/MongoDB/Connection.pm line 519.
大家有没有哪位知道这个是啥原因呢? |
|