无法通过包“MongoDB :: MongoClient”找到对象方法“new”

时间:2016-01-25 12:43:39

标签: mongodb perl

服务器 - Ubuntu 12.04 LTS

perl -MMongoDB -wle'打印MongoDB-> VERSION' - 0.45

db.version() - 2.0.6

public class Invoice {

    private static int static_id;

    private int id;
    private String date;
    private List<Product> listofproduct = new ArrayList<Product>();
    private boolean open;
}


public class Product {

    private static int count = 0;

    private int code;
    private String name;
    private String description;
    private double price;
}

如果没有在服务器上进行任何升级,我该如何解决这个问题?

方法“连接”也不起作用。

my $dbh = MongoDB::MongoClient->new(host => 'localhost', port => 27017);

1 个答案:

答案 0 :(得分:3)

那时候连接的功能是

$conn = MongoDB::Connection->new("host" => "localhost:27017");