Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linqpad and mongodb

is it possible to use linqpad with MongoDB? or any other tool for that matter that allows you to use linq to run adhoc queries on mongo.

I've tried using the shell to write the queries in json, but the brackets, quotes, colons are driving me absolutely insane.

If there isn't a tool, I'm going to resort to writing my queries in c# and compiling/running.

like image 221
Jamona Mican Avatar asked Nov 19 '12 19:11

Jamona Mican


2 Answers

It seems other are able to do it as the choosen answer of this question indicates: are adhoc queries/updates starting to kill your productivity with MongoDB?

And here is a tutorial showing how to set it up.

like image 149
tobsen Avatar answered Sep 29 '22 06:09

tobsen


I've written an adapter for LinqPad to use the official 10gen driver. It's available as an open source project on my github:

https://github.com/gburgett/LinqPad-mongo-driver

It allows you to map collections to C# types loaded from your own .dll assemblies. The collections will then appear as properties of type MongoCollection<TColl> which you can use LINQ queries against. It will even expose in the "SQL" tab the JSON of the query that was executed.

I've been using this in my office for some time, and have over time added support for a variety of usages that we have needed in our office, for instance custom serializers and other once-per-appdomain initializations.

like image 26
Gordon Burgett Avatar answered Sep 29 '22 06:09

Gordon Burgett