Wynn Netherland changelog.com/posts

NoRM - Bringing MongoDB to .NET, LINQ, and Mono

Just because you’re slinging C# doesn’t mean that Microsoft SQL Server is the only database in town, you know. Want to play with MongoDB? Then give NoRM from Andrew Theken a look. NoRM aims to:

  • Wrap the standard MongoDB operations in a strongly-typed interface
  • Provide ultra fast serialization of BSON to .NET CLR types and back
  • LINQ-to-Mongo support
  • Mono compatability

A quick code example from the Wiki:

//open collection
var coll = (new MongoServer()).GetDatabase("Northwind")
                  .GetCollection<Product>();
//create a new object to be added to the collection
var obj = new Product();
obj._id = BSONOID.NewOID();
obj.Title = "Shoes";
//save the object
coll.Insert(obj);
//find the object
var obj2 = coll.FindOne(new { _id = obj._id}).First();

Glad to see Northwind Traders has upgraded to MongoDB…

[Source on GitHub]


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00