Skip to content
This repository was archived by the owner on Dec 30, 2020. It is now read-only.

Getting Started

samus edited this page Sep 13, 2010 · 5 revisions

Connecting

Connect to a Mongo server running on localhost and the default port.


    using MongoDB.Driver;
    Mongo mongo = new Mongo();
    mongo.Connect();

Querying

Now lets do a simple query that pulls everything from a collection.


    mongo["database_name"]["collection_name"].FindAll();
    foreach(Document result in c.Documents){            
        Console.WriteLine(result.ToString());
    } 
Clone this wiki locally