SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
MongoDB for C# Developers
Simon Elliston Ball
@sireb

Saturday, 12 October 13
http://www.mongodb.org/

Saturday, 12 October 13
Document Database

Saturday, 12 October 13
Document Database
id

full_name

address

1

3a Test Street

2

John
Smith
Jane Doe

1b Fake Street

3

...

...

Saturday, 12 October 13
Document Database
id

address

1

John
Smith
Jane Doe

3a Test Street

2

1b Fake Street

3
id

full_name

...

...

1

customer_i
d
1

...

order_dat
e
2013-10-1

2

1

...

0
...

3

...

...

...

Saturday, 12 October 13
Document Database
id

full_name

address

1

John
Smith
Jane Doe

3a Test Street

2

1b Fake Street

id

customer_id
...

1

3

1

1

2
customer_i
d3
1

2

1

...

3

...

...

id

Saturday, 12 October 13

1
......

... order_date
2013-10-10

order_dat ...
e
2013-10-1 ...
0
...
...
Document Database
id

full_name

address

1

John
Smith
Jane Doe

3a Test Street

2

1b Fake Street

id

customer_id
...

1

3

1

1

2
customer_i
d3
1

2

1

...

3

...

...

id

Saturday, 12 October 13

1
......

... order_date
2013-10-10

order_dat ...
e
2013-10-1 ...
0
...
...
Document Database
id

full_name

address

1

John
Smith
Jane Doe

3a Test Street

2

1b Fake Street

id

customer_id
...

1

3

1

1

2
customer_i
d3
1

2

1

...

3

...

...

id

Saturday, 12 October 13

1
......

... order_date
2013-10-10

order_dat ...
e
2013-10-1 ...
0
...
...

customers = [
{
"_id" : ObjectId("5256b399ac46b80084974d9a"),
"name" : "John Smith",
"address" : "3a Test Street",
"orders" [ {
"order_date": "2013-10-10",
"order_item": [
{ "product": "Widget"...}
...
]
...
}]
},
{
"_id" : ObjectId("5256b3a8ac46b80084974d9b"),
"name" : "Jane Doe",
"address" : "1b Fake Street"
}
]
Key -> JSON

Saturday, 12 October 13
Saturday, 12 October 13
Saturday, 12 October 13
Saturday, 12 October 13
•

Transactions per document

•

ACID, multi-document

•

Master-slave replication

•

Master-master replication

•

Many many languages: C#,

•

.NET Only

JavaScript, Java, PHP, Python, Ruby,
Scala, Erlang, Go, C, C++, Perl (and those are just
the official ones)

Saturday, 12 October 13
Getting started with MongoDB
Download from http://www.mongodb.org/

Saturday, 12 October 13
Saturday, 12 October 13
Getting started with the C# client
PM> Install-Package mongocsharpdriver

Saturday, 12 October 13
Saturday, 12 October 13
Wooah there.
I thought you said JSON...

Saturday, 12 October 13
BSON Binary JSON

Saturday, 12 October 13
BSON Binary JSON
Typed

Saturday, 12 October 13
BSON Binary JSON
Typed
Serialisation library

Saturday, 12 October 13
BSON Binary JSON
Typed
Serialisation library
Annotate POCOs to control mapping
or write config code if you must

Saturday, 12 October 13
Connecting...
var connectionString = "mongodb://localhost";
var client = new MongoClient(connectionString);
var server = client.GetServer();

Saturday, 12 October 13
Connecting...
var connectionString = "mongodb://localhost";
var client = new MongoClient(connectionString);
var server = client.GetServer();

That’s it.
The driver will disconnect,
release objects and pool for you.
But...
Saturday, 12 October 13
Collections
Database
Collection
Document
_id
field

Saturday, 12 October 13
CRUD creating new documents
With mapped entities:
var developerCollection = database.GetCollection<Developer>("team");
var Developer = new Developer(1,"Test", "Person");
developerCollection.Insert(Developer);
var Developer2 = new Developer(2,"Another", "Developer");
developerCollection.Insert(Developer2)

The BsonDocument way:
var documentCollection = database.GetCollection("team");
BsonDocument document = new BsonDocument();
document.Add(new BsonElement("name", "Testing"))
.Add(new BsonElement("number", new BsonInt32(42)));
documentCollection.Insert(document);
Saturday, 12 October 13
CRUD creating new documents
The BsonDocument way:
var documentCollection = database.GetCollection("team");
BsonDocument document = new BsonDocument();
document.Add(new BsonElement("name", "Testing"))
.Add(new BsonElement("number", new BsonInt32(42)));
documentCollection.Insert(document);

Beware of mixing your BSONs
List<Developer> allDevelopers = developerResults.ToList<Developer>();

Saturday, 12 October 13
CRUD creating new documents
Beware of mixing your BSONs
List<Developer> allDevelopers = developerResults.ToList<Developer>();

Saturday, 12 October 13
CRUD basic document reads
MongoCursor<BsonDocument> documentResults = documentCollection.FindAll();
MongoCursor<Developer> developerResults = developerCollection.FindAll();

Saturday, 12 October 13
CRUD basic document reads
MongoCursor<BsonDocument> documentResults = documentCollection.FindAll();
MongoCursor<Developer> developerResults = developerCollection.FindAll();
var cursor = collection.FindAll();
cursor.Skip = 100;
cursor.Limit = 10;
foreach (var developer in cursor) {
...

Saturday, 12 October 13
CRUD basic document reads
MongoCursor<BsonDocument> documentResults = documentCollection.FindAll();
MongoCursor<Developer> developerResults = developerCollection.FindAll();
var cursor = collection.FindAll();
cursor.Skip = 100;
cursor.Limit = 10;
foreach (var developer in cursor) {
...
}

var readQuery = Query<Developer>.EQ(n => n.PersonId, 2);
Developer developerRead = developerCollection.FindOne(readQuery);

Saturday, 12 October 13
CRUD basic document reads
MongoCursor<BsonDocument> documentResults = documentCollection.FindAll();
MongoCursor<Developer> developerResults = developerCollection.FindAll();
var cursor = collection.FindAll();
cursor.Skip = 100;
cursor.Limit = 10;
foreach (var developer in cursor) {
...
}

var readQuery = Query<Developer>.EQ(n => n.PersonId, 2);
Developer developerRead = developerCollection.FindOne(readQuery);
BsonDocument documentRead = documentCollection.FindOne(new QueryDocument {
{ "_id", documentId }
});
Saturday, 12 October 13
CRUD update
developerRead.LastName = "Something-Else";
developerCollection.Save(developerRead);

Saturday, 12 October 13
CRUD update
Write Concerns
Only relevant with Replication
The number replica which need to report successful writes
collection.Save(developerRead, new MongoInsertOptions
{
WriteConcern = WriteConcern.WMajority
}
);

Saturday, 12 October 13
CRUD update
var update = new UpdateDocument {
{ "$set", new BsonDocument("LastName", "A new name") }
};
var query = new QueryDocument {
{ "LastName", "Developer" }
};
collection.Update(query, update);
NB. Only updates one document

Saturday, 12 October 13
CRUD update
var update = new UpdateDocument {
{ "$set", new BsonDocument("LastName", "A new name") }
};
var query = new QueryDocument {
{ "LastName", "Developer" }
};
collection.Update(query, update);
NB. Only updates one document
collection.Update(query, update, new MongoUpdateOptions
{
Flags = UpdateFlags.Multi
});
Applies to all documents that match query

Saturday, 12 October 13
CRUD upsert
var update = new UpdateDocument {
{ "$set", new BsonDocument("LastName", "A new name") }
};
var query = Query<Developer>.EQ(d => d.PersonId, 10);
collection.Update(query, update, new MongoUpdateOptions
{
Flags = UpdateFlags.Upsert
});

Saturday, 12 October 13
CRUD deleting
var query = new QueryDocument {
{ "LastName", "Person" }
};
collection.Remove(query);

Saturday, 12 October 13
CRUD deleting
var query = new QueryDocument {
{ "LastName", "Person" }
};
collection.Remove(query);

collection.RemoveAll();
collection.Drop();

Saturday, 12 October 13
LINQ integration
Just make the collection queryable
using System.Linq;
using MongoDB.Driver.Linq;
var query =

from e in collection.AsQueryable()
where e.LastName == "Person"
select e;

foreach (var developer in query){
...

Saturday, 12 October 13
GridFS in C#
16MB document limit
GridFS used to break documents into chunks
using (var fs = new FileStream("largeVideo.m4v", FileMode.Open))
{
database.GridFS.Upload(fs, "largeVideo.m4v");
}
database.GridFS.Download("test.m4v", "largeVideo.m4v");

Saturday, 12 October 13
MapReduce (JavaScript)
var map =
"function() {" +
"
for (var key in this) {" +
"
emit(key, { count : 1 });" +
"
}" +
"}";
var reduce =
"function(key, emits) {" +
"
total = 0;" +
"
for (var i in emits) {" +
"
total += emits[i].count;" +
"
}" +
"
return { count : total };" +
"}";
var mr = collection.MapReduce(map, reduce);

Yes, it’s a word count. Yes, it’s JavaScript.
Saturday, 12 October 13
Special Queries GeoNear
var query = Query.EQ("properties.amenity", new BsonString("pub"));
// here
double lon = 54.9117468;
double lat = -1.3737675;
var earthRadius = 6378.0; // km
var rangeInKm = 3000.0; // km
var options = GeoNearOptions
.SetMaxDistance(rangeInKm / earthRadius /* to radians */)
.SetSpherical(true);
var results = collection.GeoNear(query, lat, lon, 10, options);
foreach (var result in results.Hits)
...

Saturday, 12 October 13
Acknowledgements
MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.

Saturday, 12 October 13
Resources
The MongoDB C Sharp Language Center:
http://docs.mongodb.org/ecosystem/drivers/csharp/
A tutorial on the driver from MongoDB themselves:
http://docs.mongodb.org/ecosystem/tutorial/use-csharp-driver/#csharp-driver-tutorial
Sample code from this talk:
https://github.com/simonellistonball/MongoForCsharpSamples
A good walkthrough on MongoDB with ASP.NET MVC:
http://www.drdobbs.com/database/mongodb-with-c-deep-dive/240152181

Bonus extras
A Glimpse plugin to view mongo query details:
https://github.com/simonellistonball/Glimpse.MongoDB

Saturday, 12 October 13
Questions?
Simon Elliston Ball
simon.ellistonball@red-gate.com
@sireb

Saturday, 12 October 13

Weitere ähnliche Inhalte

Was ist angesagt?

Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMongoDB
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDBTakahiro Inoue
 
MongoDB Performance Debugging
MongoDB Performance DebuggingMongoDB Performance Debugging
MongoDB Performance DebuggingMongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...MongoDB
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニングYuichi Matsuo
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsAlexander Rubin
 
Webinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaWebinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaMongoDB
 
Getting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJSGetting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJSMongoDB
 
HeadCouch - CouchDB PHP Client
HeadCouch - CouchDB PHP ClientHeadCouch - CouchDB PHP Client
HeadCouch - CouchDB PHP ClientDimitar Ivanov
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196Mahmoud Samir Fayed
 
Mongodb debugging-performance-problems
Mongodb debugging-performance-problemsMongodb debugging-performance-problems
Mongodb debugging-performance-problemsMongoDB
 
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB
 
File System Operations
File System OperationsFile System Operations
File System OperationsG.C Reddy
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2Takahiro Inoue
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101Will Button
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applicationsjeromevdl
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programmingCasear Chu
 

Was ist angesagt? (20)

Mongo db presentation
Mongo db presentationMongo db presentation
Mongo db presentation
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
MongoDB Performance Debugging
MongoDB Performance DebuggingMongoDB Performance Debugging
MongoDB Performance Debugging
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニング
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
 
Webinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and MorphiaWebinar: MongoDB Persistence with Java and Morphia
Webinar: MongoDB Persistence with Java and Morphia
 
Getting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJSGetting Started with MongoDB and NodeJS
Getting Started with MongoDB and NodeJS
 
HeadCouch - CouchDB PHP Client
HeadCouch - CouchDB PHP ClientHeadCouch - CouchDB PHP Client
HeadCouch - CouchDB PHP Client
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196
 
Mongodb debugging-performance-problems
Mongodb debugging-performance-problemsMongodb debugging-performance-problems
Mongodb debugging-performance-problems
 
Elastic search 검색
Elastic search 검색Elastic search 검색
Elastic search 검색
 
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
MongoDB Europe 2016 - Enabling the Internet of Things at Proximus - Belgium's...
 
File System Operations
File System OperationsFile System Operations
File System Operations
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
Softshake - Offline applications
Softshake - Offline applicationsSoftshake - Offline applications
Softshake - Offline applications
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programming
 

Ähnlich wie Mongo db for C# Developers

Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingWeizhong Yang
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruTim Callaghan
 
Securing Client Side Data
 Securing Client Side Data Securing Client Side Data
Securing Client Side DataGrgur Grisogono
 
Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012aleks-f
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourPeter Friese
 
Scala in hulu's data platform
Scala in hulu's data platformScala in hulu's data platform
Scala in hulu's data platformPrasan Samtani
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4Jan Berdajs
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformRadek Simko
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshopMathieu Elie
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developersSergio Bossa
 
Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1ArangoDB Database
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)Chris Richardson
 
Redis the better NoSQL
Redis the better NoSQLRedis the better NoSQL
Redis the better NoSQLOpenFest team
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installationKishor Parkhe
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04Krishna Sankar
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
 
PHP Loves MongoDB - Dublin MUG (by Hannes)
PHP Loves MongoDB - Dublin MUG (by Hannes)PHP Loves MongoDB - Dublin MUG (by Hannes)
PHP Loves MongoDB - Dublin MUG (by Hannes)Mark Hillick
 
Mongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeMongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeSpyros Passas
 

Ähnlich wie Mongo db for C# Developers (20)

Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB Guru
 
Securing Client Side Data
 Securing Client Side Data Securing Client Side Data
Securing Client Side Data
 
Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
Scala in hulu's data platform
Scala in hulu's data platformScala in hulu's data platform
Scala in hulu's data platform
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4
 
Declarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with TerraformDeclarative & workflow based infrastructure with Terraform
Declarative & workflow based infrastructure with Terraform
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)
 
Redis the better NoSQL
Redis the better NoSQLRedis the better NoSQL
Redis the better NoSQL
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installation
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
 
Nosql hands on handout 04
Nosql hands on handout 04Nosql hands on handout 04
Nosql hands on handout 04
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
PHP Loves MongoDB - Dublin MUG (by Hannes)
PHP Loves MongoDB - Dublin MUG (by Hannes)PHP Loves MongoDB - Dublin MUG (by Hannes)
PHP Loves MongoDB - Dublin MUG (by Hannes)
 
Mongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappeMongo db php_shaken_not_stirred_joomlafrappe
Mongo db php_shaken_not_stirred_joomlafrappe
 
Latinoware
LatinowareLatinoware
Latinoware
 

Mehr von Simon Elliston Ball

A streaming architecture for Cyber Security - Apache Metron
A streaming architecture for Cyber Security - Apache MetronA streaming architecture for Cyber Security - Apache Metron
A streaming architecture for Cyber Security - Apache MetronSimon Elliston Ball
 
mcubed london - data science at the edge
mcubed london - data science at the edgemcubed london - data science at the edge
mcubed london - data science at the edgeSimon Elliston Ball
 
When to no sql and when to know sql javaone
When to no sql and when to know sql   javaoneWhen to no sql and when to know sql   javaone
When to no sql and when to know sql javaoneSimon Elliston Ball
 
Machine learning without the PhD - azure ml
Machine learning without the PhD - azure mlMachine learning without the PhD - azure ml
Machine learning without the PhD - azure mlSimon Elliston Ball
 
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...Simon Elliston Ball
 
Getting your Big Data on with HDInsight
Getting your Big Data on with HDInsightGetting your Big Data on with HDInsight
Getting your Big Data on with HDInsightSimon Elliston Ball
 
Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Simon Elliston Ball
 
Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Simon Elliston Ball
 
Finding and Using Big Data in your business
Finding and Using Big Data in your businessFinding and Using Big Data in your business
Finding and Using Big Data in your businessSimon Elliston Ball
 
When to NoSQL and when to know SQL
When to NoSQL and when to know SQLWhen to NoSQL and when to know SQL
When to NoSQL and when to know SQLSimon Elliston Ball
 

Mehr von Simon Elliston Ball (10)

A streaming architecture for Cyber Security - Apache Metron
A streaming architecture for Cyber Security - Apache MetronA streaming architecture for Cyber Security - Apache Metron
A streaming architecture for Cyber Security - Apache Metron
 
mcubed london - data science at the edge
mcubed london - data science at the edgemcubed london - data science at the edge
mcubed london - data science at the edge
 
When to no sql and when to know sql javaone
When to no sql and when to know sql   javaoneWhen to no sql and when to know sql   javaone
When to no sql and when to know sql javaone
 
Machine learning without the PhD - azure ml
Machine learning without the PhD - azure mlMachine learning without the PhD - azure ml
Machine learning without the PhD - azure ml
 
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...
Why Hadoop and SQL just want to be friends - lightning talk NoSQL Matters Dub...
 
Getting your Big Data on with HDInsight
Getting your Big Data on with HDInsightGetting your Big Data on with HDInsight
Getting your Big Data on with HDInsight
 
Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0
 
Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0Riding the Elephant - Hadoop 2.0
Riding the Elephant - Hadoop 2.0
 
Finding and Using Big Data in your business
Finding and Using Big Data in your businessFinding and Using Big Data in your business
Finding and Using Big Data in your business
 
When to NoSQL and when to know SQL
When to NoSQL and when to know SQLWhen to NoSQL and when to know SQL
When to NoSQL and when to know SQL
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Mongo db for C# Developers

  • 1. MongoDB for C# Developers Simon Elliston Ball @sireb Saturday, 12 October 13
  • 4. Document Database id full_name address 1 3a Test Street 2 John Smith Jane Doe 1b Fake Street 3 ... ... Saturday, 12 October 13
  • 5. Document Database id address 1 John Smith Jane Doe 3a Test Street 2 1b Fake Street 3 id full_name ... ... 1 customer_i d 1 ... order_dat e 2013-10-1 2 1 ... 0 ... 3 ... ... ... Saturday, 12 October 13
  • 6. Document Database id full_name address 1 John Smith Jane Doe 3a Test Street 2 1b Fake Street id customer_id ... 1 3 1 1 2 customer_i d3 1 2 1 ... 3 ... ... id Saturday, 12 October 13 1 ...... ... order_date 2013-10-10 order_dat ... e 2013-10-1 ... 0 ... ...
  • 7. Document Database id full_name address 1 John Smith Jane Doe 3a Test Street 2 1b Fake Street id customer_id ... 1 3 1 1 2 customer_i d3 1 2 1 ... 3 ... ... id Saturday, 12 October 13 1 ...... ... order_date 2013-10-10 order_dat ... e 2013-10-1 ... 0 ... ...
  • 8. Document Database id full_name address 1 John Smith Jane Doe 3a Test Street 2 1b Fake Street id customer_id ... 1 3 1 1 2 customer_i d3 1 2 1 ... 3 ... ... id Saturday, 12 October 13 1 ...... ... order_date 2013-10-10 order_dat ... e 2013-10-1 ... 0 ... ... customers = [ { "_id" : ObjectId("5256b399ac46b80084974d9a"), "name" : "John Smith", "address" : "3a Test Street", "orders" [ { "order_date": "2013-10-10", "order_item": [ { "product": "Widget"...} ... ] ... }] }, { "_id" : ObjectId("5256b3a8ac46b80084974d9b"), "name" : "Jane Doe", "address" : "1b Fake Street" } ]
  • 9. Key -> JSON Saturday, 12 October 13
  • 13. • Transactions per document • ACID, multi-document • Master-slave replication • Master-master replication • Many many languages: C#, • .NET Only JavaScript, Java, PHP, Python, Ruby, Scala, Erlang, Go, C, C++, Perl (and those are just the official ones) Saturday, 12 October 13
  • 14. Getting started with MongoDB Download from http://www.mongodb.org/ Saturday, 12 October 13
  • 16. Getting started with the C# client PM> Install-Package mongocsharpdriver Saturday, 12 October 13
  • 18. Wooah there. I thought you said JSON... Saturday, 12 October 13
  • 19. BSON Binary JSON Saturday, 12 October 13
  • 21. BSON Binary JSON Typed Serialisation library Saturday, 12 October 13
  • 22. BSON Binary JSON Typed Serialisation library Annotate POCOs to control mapping or write config code if you must Saturday, 12 October 13
  • 23. Connecting... var connectionString = "mongodb://localhost"; var client = new MongoClient(connectionString); var server = client.GetServer(); Saturday, 12 October 13
  • 24. Connecting... var connectionString = "mongodb://localhost"; var client = new MongoClient(connectionString); var server = client.GetServer(); That’s it. The driver will disconnect, release objects and pool for you. But... Saturday, 12 October 13
  • 26. CRUD creating new documents With mapped entities: var developerCollection = database.GetCollection<Developer>("team"); var Developer = new Developer(1,"Test", "Person"); developerCollection.Insert(Developer); var Developer2 = new Developer(2,"Another", "Developer"); developerCollection.Insert(Developer2) The BsonDocument way: var documentCollection = database.GetCollection("team"); BsonDocument document = new BsonDocument(); document.Add(new BsonElement("name", "Testing")) .Add(new BsonElement("number", new BsonInt32(42))); documentCollection.Insert(document); Saturday, 12 October 13
  • 27. CRUD creating new documents The BsonDocument way: var documentCollection = database.GetCollection("team"); BsonDocument document = new BsonDocument(); document.Add(new BsonElement("name", "Testing")) .Add(new BsonElement("number", new BsonInt32(42))); documentCollection.Insert(document); Beware of mixing your BSONs List<Developer> allDevelopers = developerResults.ToList<Developer>(); Saturday, 12 October 13
  • 28. CRUD creating new documents Beware of mixing your BSONs List<Developer> allDevelopers = developerResults.ToList<Developer>(); Saturday, 12 October 13
  • 29. CRUD basic document reads MongoCursor<BsonDocument> documentResults = documentCollection.FindAll(); MongoCursor<Developer> developerResults = developerCollection.FindAll(); Saturday, 12 October 13
  • 30. CRUD basic document reads MongoCursor<BsonDocument> documentResults = documentCollection.FindAll(); MongoCursor<Developer> developerResults = developerCollection.FindAll(); var cursor = collection.FindAll(); cursor.Skip = 100; cursor.Limit = 10; foreach (var developer in cursor) { ... Saturday, 12 October 13
  • 31. CRUD basic document reads MongoCursor<BsonDocument> documentResults = documentCollection.FindAll(); MongoCursor<Developer> developerResults = developerCollection.FindAll(); var cursor = collection.FindAll(); cursor.Skip = 100; cursor.Limit = 10; foreach (var developer in cursor) { ... } var readQuery = Query<Developer>.EQ(n => n.PersonId, 2); Developer developerRead = developerCollection.FindOne(readQuery); Saturday, 12 October 13
  • 32. CRUD basic document reads MongoCursor<BsonDocument> documentResults = documentCollection.FindAll(); MongoCursor<Developer> developerResults = developerCollection.FindAll(); var cursor = collection.FindAll(); cursor.Skip = 100; cursor.Limit = 10; foreach (var developer in cursor) { ... } var readQuery = Query<Developer>.EQ(n => n.PersonId, 2); Developer developerRead = developerCollection.FindOne(readQuery); BsonDocument documentRead = documentCollection.FindOne(new QueryDocument { { "_id", documentId } }); Saturday, 12 October 13
  • 33. CRUD update developerRead.LastName = "Something-Else"; developerCollection.Save(developerRead); Saturday, 12 October 13
  • 34. CRUD update Write Concerns Only relevant with Replication The number replica which need to report successful writes collection.Save(developerRead, new MongoInsertOptions { WriteConcern = WriteConcern.WMajority } ); Saturday, 12 October 13
  • 35. CRUD update var update = new UpdateDocument { { "$set", new BsonDocument("LastName", "A new name") } }; var query = new QueryDocument { { "LastName", "Developer" } }; collection.Update(query, update); NB. Only updates one document Saturday, 12 October 13
  • 36. CRUD update var update = new UpdateDocument { { "$set", new BsonDocument("LastName", "A new name") } }; var query = new QueryDocument { { "LastName", "Developer" } }; collection.Update(query, update); NB. Only updates one document collection.Update(query, update, new MongoUpdateOptions { Flags = UpdateFlags.Multi }); Applies to all documents that match query Saturday, 12 October 13
  • 37. CRUD upsert var update = new UpdateDocument { { "$set", new BsonDocument("LastName", "A new name") } }; var query = Query<Developer>.EQ(d => d.PersonId, 10); collection.Update(query, update, new MongoUpdateOptions { Flags = UpdateFlags.Upsert }); Saturday, 12 October 13
  • 38. CRUD deleting var query = new QueryDocument { { "LastName", "Person" } }; collection.Remove(query); Saturday, 12 October 13
  • 39. CRUD deleting var query = new QueryDocument { { "LastName", "Person" } }; collection.Remove(query); collection.RemoveAll(); collection.Drop(); Saturday, 12 October 13
  • 40. LINQ integration Just make the collection queryable using System.Linq; using MongoDB.Driver.Linq; var query = from e in collection.AsQueryable() where e.LastName == "Person" select e; foreach (var developer in query){ ... Saturday, 12 October 13
  • 41. GridFS in C# 16MB document limit GridFS used to break documents into chunks using (var fs = new FileStream("largeVideo.m4v", FileMode.Open)) { database.GridFS.Upload(fs, "largeVideo.m4v"); } database.GridFS.Download("test.m4v", "largeVideo.m4v"); Saturday, 12 October 13
  • 42. MapReduce (JavaScript) var map = "function() {" + " for (var key in this) {" + " emit(key, { count : 1 });" + " }" + "}"; var reduce = "function(key, emits) {" + " total = 0;" + " for (var i in emits) {" + " total += emits[i].count;" + " }" + " return { count : total };" + "}"; var mr = collection.MapReduce(map, reduce); Yes, it’s a word count. Yes, it’s JavaScript. Saturday, 12 October 13
  • 43. Special Queries GeoNear var query = Query.EQ("properties.amenity", new BsonString("pub")); // here double lon = 54.9117468; double lat = -1.3737675; var earthRadius = 6378.0; // km var rangeInKm = 3000.0; // km var options = GeoNearOptions .SetMaxDistance(rangeInKm / earthRadius /* to radians */) .SetSpherical(true); var results = collection.GeoNear(query, lat, lon, 10, options); foreach (var result in results.Hits) ... Saturday, 12 October 13
  • 44. Acknowledgements MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc. Saturday, 12 October 13
  • 45. Resources The MongoDB C Sharp Language Center: http://docs.mongodb.org/ecosystem/drivers/csharp/ A tutorial on the driver from MongoDB themselves: http://docs.mongodb.org/ecosystem/tutorial/use-csharp-driver/#csharp-driver-tutorial Sample code from this talk: https://github.com/simonellistonball/MongoForCsharpSamples A good walkthrough on MongoDB with ASP.NET MVC: http://www.drdobbs.com/database/mongodb-with-c-deep-dive/240152181 Bonus extras A Glimpse plugin to view mongo query details: https://github.com/simonellistonball/Glimpse.MongoDB Saturday, 12 October 13