|
1 |
| -## MongoDB C# Driver |
| 1 | +MongoDB C# Driver |
| 2 | +================= |
2 | 3 |
|
3 |
| -documentation: http://www.mongodb.org/display/DOCS/CSharp+Language+Center |
4 |
| -apidoc: http://api.mongodb.org/csharp/ |
| 4 | +You can get the latest stable release from the [official Nuget.org feed](http://www.nuget.org/packages/mongocsharpdriver) or from our [github releases page](https://github.com/mongodb/mongo-csharp-driver/releases). |
5 | 5 |
|
6 |
| -source code: http://github.com/mongodb/mongo-csharp-driver |
| 6 | +If you'd like to work with the bleeding edge, you can use our [build feed](https://www.myget.org/gallery/mongocsharpdriverbuild). Packages on this feed are pre-release and, while they've passed all our tests, are not yet ready for production. |
7 | 7 |
|
8 |
| -mongodb home: http://www.mongodb.org/ |
| 8 | +Build Status |
| 9 | +------------ |
9 | 10 |
|
10 |
| -### Questions and Bug Reports |
| 11 | +[](http://jenkins.bci.10gen.cc:8080/job/mongo-csharp-driver-1.x/) |
11 | 12 |
|
12 |
| - * mailing list: http://groups.google.com/group/mongodb-user |
13 |
| - * jira: http://jira.mongodb.org/ |
| 13 | +Getting Started |
| 14 | +--------------- |
14 | 15 |
|
15 |
| -### Change Log |
| 16 | +### Untyped Documents |
| 17 | +```C# |
| 18 | +using MongoDB.Bson; |
| 19 | +using MongoDB.Driver; |
| 20 | +``` |
16 | 21 |
|
17 |
| -http://jira.mongodb.org/browse/CSHARP |
| 22 | +```C# |
| 23 | +var client = new MongoClient("mongodb://localhost:27017"); |
| 24 | +var server = client.GetServer(); |
| 25 | +var database = server.GetDatabase("foo"); |
| 26 | +var collection = database.GetCollection("bar"); |
| 27 | + |
| 28 | +collection.Insert(new BsonDocument("Name", "Jack")); |
| 29 | + |
| 30 | +foreach(var document in collection.FindAll()) |
| 31 | +{ |
| 32 | + Console.WriteLine(document["Name"]); |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +### Typed Documents |
| 37 | + |
| 38 | +```C# |
| 39 | +using MongoDB.Bson; |
| 40 | +using MongoDB.Driver; |
| 41 | +``` |
| 42 | + |
| 43 | +```C# |
| 44 | +public class Person |
| 45 | +{ |
| 46 | + public ObjectId Id { get; set; } |
| 47 | + public string Name { get; set; } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +```C# |
| 52 | +var client = new MongoClient("mongodb://localhost:27017"); |
| 53 | +var server = client.GetServer(); |
| 54 | +var database = server.GetDatabase("foo"); |
| 55 | +var collection = database.GetCollection<Person>("bar"); |
| 56 | + |
| 57 | +collection.Insert(new Person { Name = "Jack" }); |
| 58 | + |
| 59 | +foreach(var person in collection.FindAll()) |
| 60 | +{ |
| 61 | + Console.WriteLine(person.Name); |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +Documentation |
| 66 | +------------- |
| 67 | +* [MongoDB](http://www.mongodb.org/) |
| 68 | +* [Documentation](http://www.mongodb.org/display/DOCS/CSharp+Language+Center) |
| 69 | +* [Api Documentation](http://api.mongodb.org/csharp/) |
| 70 | + |
| 71 | +Questions/Bug Reports |
| 72 | +--------------------- |
| 73 | +* [Discussion Forum](http://groups.google.com/group/mongodb-user) |
| 74 | +* [Stack Overflow](http://stackoverflow.com/questions/tagged/mongodb) |
| 75 | +* [Jira](https://jira.mongodb.org/browse/CSHARP) |
| 76 | +* [Jabbr](https://jabbr.net/#/rooms/mongodb) |
| 77 | + |
| 78 | +If you’ve identified a security vulnerability in a driver or any other MongoDB project, please report it according to the [instructions here](http://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report). |
| 79 | + |
| 80 | +Contributing |
| 81 | +------------ |
| 82 | + |
| 83 | +Please see our [guidelines](CONTRIBUTING.md) for contributing to the driver. |
18 | 84 |
|
19 | 85 | ### Maintainers:
|
20 | 86 |
|
21 | 87 |
|
22 | 88 |
|
23 |
| -### Contributors: |
| 89 | +### Contributors (in alphabetical order): |
24 | 90 | * Bit Diffusion Limited [email protected]
|
25 | 91 | * Alex Brown https://github.com/alexjamesbrown
|
26 | 92 | * Justin Dearing [email protected]
|
|
0 commit comments