My opinion on mappings for MongoDB

I think that enforcing mappings when using MongoDb is like taking a step towards an OR/M instead of away from it, and in my opinion: away is better. A strength with MongoDB is that it’s schema less, why then add fictive schemas by adding mappings in your C# code?

The driver I’m building uses Json.Net so that I can serialize/deserialize objects (anonymous types, static types, JSON-strings) back and forth between the DB and my conceptual model.

If you are using Sam Corders more mature C#-driver you migth wan’t to look at my earlier writings to get rid of manual mappings. You might also want to checkout Automapper to handle mappings with Dictionaries.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s