Skip to content

Instantly share code, notes, and snippets.

@house9
Created May 3, 2011 23:31
Show Gist options
  • Save house9/954461 to your computer and use it in GitHub Desktop.
Save house9/954461 to your computer and use it in GitHub Desktop.
Simple.Data with MongoDB
using Simple.Data;
using Simple.Data.MongoDB;
// connect
dynamic db = Database.Opener.OpenMongo("mongodb://localhost:27017/myDB");
// insert
dynamic user = new ExpandoObject();
user.FirstName = "Joe";
user.LastName = "Smith";
user.Email = "jsmith@test.com";
db.Users.Insert(user);
// find
dynamic existingUser = db.Users.FindByEmail("jsmith@test.com");
@house9
Copy link
Author

house9 commented Jul 13, 2011

Not sure if you got it to work?
Maybe post at the authors repo https://github.com/craiggwilson/Simple.Data.MongoDB
I only messed around with this for a few days, and that was months ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment