我正在尝试在Mongoid 3.1下运行自定义javascript命令
User.collection.database.session.cluster.with_primary do
p User.collection.database.command(eval: 'function() { return 3+3; }')
end
我只有这个错误:
Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">, <Moped::Node resolved_address="127.0.0.1:27018">, <Moped::Node resolved_address="127.0.0.1:27019">]>