I'm new in MongoDB and I've tried to do a simple code to see if its works or not :
MongoServer server = MongoServer.Create();
MongoDatabase test = server.GetDatabase("test");
MongoCollection<BsonDocument> books =
test.GetCollection<BsonDocument>("books");
BsonDocument book = new BsonDocument {
{ "author", "Ernest Hemingway" },
{ "title", "For Whom the Bell Tolls" }
};
books.Insert(book);
but when I run this example it gives me an error :
No connection could be made because the target machine actively refused it 127.0.0.1:27017
I'm using VS2008 .
how to fix this ?! Thank u