How to use MongoDB from PowerShell and F#

by Doug Finke on October 25, 2009

in F#,MongoDB,PowerShell

Dwight Merriman, founder of 10gen,  presented today, at Lab49 where I work, about his new database platform:

Mongo (from "humongous") is a high-performance, open source, schema-free document-oriented database. MongoDB is written in C++ and offers the following features:

  • Collection oriented storage: easy storage of object/JSON -style data
  • Dynamic queries
  • Full index support, including on inner objects and embedded arrays
  • Query profiling
  • Replication and fail-over support
  • Efficient storage of binary data including large objects (e.g. photos and videos)
  • Auto-sharding for cloud-level scalability

PowerShell

Dwight pointed out the way different languages could to talk to MongoDB and C# was one of them using a community developed driver.

Following the post Experimenting with MongoDB from C#, MongoDB was up and running and I was storing and retrieving data in no time.

image

F#

Looks like Matthew Podwysocki used the same reference and has MongoDB working with F#.

{ 3 trackbacks }

Dew Drop – October 26, 2009 | Alvin Ashcraft's Morning Dew
10.26.09 at 7:03 am
PowerShell and MongoDB « PowerShell Station
08.10.10 at 9:23 pm
ehcache.net
03.17.11 at 1:58 am

{ 4 comments… read them below or add one }

Doug Finke 03.16.11 at 5:40 pm

Doug,

Thanks for writing this article. As I mentioned when we met in the codecampnyc speaker lounge, there is a new MongoDB C# driver. Unfortunately, the crud methods are all generics even though the MongoServer class is not generic, so you need to use reflection to call them.

That being said, Robert just submitted a patch I wrote that does make one aspect of using the driver in PowerShell easier. MongoDocument now has a constructor that takes a HashTable. This allows you to create MongoDocuments with the @{} notation.

An example of using the new driver in powershell:
https://gist.github.com/854911/393238e85f03a2bd9762d55c2b0efa9162de16e1

A thread on the matter:
https://groups.google.com/d/topic/mongodb-dev/10i4wSefwA8/discussion

Doug Finke 03.17.11 at 8:15 pm

Thanks for the update about the MongDB driver.

Justin Dearing 04.25.11 at 2:16 pm

Doug,

Robert just submitted some more powershell related improvements to the mongodb driver.

https://github.com/mongodb/mongo-csharp-driver/commits/master

Doug Finke 04.25.11 at 3:25 pm

Thanks Justin.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>