# MongoDB support

**URL:** <https://community.miniprofiler.com/t/mongodb-support/151>\
**Category:** uncategorized\
**Created:** [April 30, 2012, 11:04am UTC](https://community.miniprofiler.com/t/mongodb-support/151 "2012-04-30T11:04:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajma](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@ajma](https://community.miniprofiler.com/u/ajma)\
**Post date:** [April 30, 2012, 11:04am UTC](https://community.miniprofiler.com/t/mongodb-support/151/1 "2012-04-30T11:04:15Z")

</div>

Please add support for MongoDB

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [April 30, 2012, 7:00pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/2 "2012-04-30T19:00:46Z")

</div>

How do you envisage this working?

---

<div class="post-metadata">

**Author:** ![chirea](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/chirea/32/1043_2.png) [@chirea](https://community.miniprofiler.com/u/chirea)\
**Post date:** [May 7, 2012, 7:51am UTC](https://community.miniprofiler.com/t/mongodb-support/151/3 "2012-05-07T07:51:38Z")

</div>

I suppose one can dig into the [MongoDB C# driver](https://github.com/mongodb/mongo-csharp-driver) and make something like ProfiledDbConnection but for MongoDB. Timing wouldn’t be too hard (do it client side if the server doesn’t say the query execution time) and the query is trivially to get, probably stored in a string.

I won’t have time until next months to try to get something working, but it shouldn’t be too hard.

---

<div class="post-metadata">

**Author:** ![gabe](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/gabe/32/1030_2.png) [@gabe](https://community.miniprofiler.com/u/gabe)\
**Post date:** [July 11, 2012, 2:54pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/4 "2012-07-11T14:54:50Z")

</div>

I have been just wrapping my MongoDB calls with a .Step() but it would be great to get this timing for free like I do for SQL. It would be great to see details of what I’m querying on, but even just query executing time and a summed up time spent in Mongo would be super helpful.

---

<div class="post-metadata">

**Author:** ![Bryce\_Kahle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/bryce_kahle/32/1027_2.png) [@Bryce\_Kahle](https://community.miniprofiler.com/u/Bryce_Kahle)\
**Post date:** [July 18, 2012, 12:49pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/5 "2012-07-18T12:49:39Z")

</div>

I created a fork with simultaneous Mongo and SQL support. It is far from complete, but should get you started.  
[https://github.com/brycekahle/MiniProfiler](https://github.com/brycekahle/MiniProfiler)

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [July 19, 2012, 1:56pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/6 "2012-07-19T13:56:37Z")

</div>

@Bryce do you feel like giving the prep “abstraction” work a shot? Keep in mind we already have an interface for profiling.

---

<div class="post-metadata">

**Author:** ![sam](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/sam/32/377_2.png) [@sam](https://community.miniprofiler.com/u/sam)\
**Post date:** [July 18, 2012, 1:18pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/7 "2012-07-18T13:18:27Z")

</div>

how do we go about integrating this into the core

---

<div class="post-metadata">

**Author:** ![Bryce\_Kahle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/bryce_kahle/32/1027_2.png) [@Bryce\_Kahle](https://community.miniprofiler.com/u/Bryce_Kahle)\
**Post date:** [July 18, 2012, 4:10pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/8 "2012-07-18T16:10:14Z")

</div>

I think a first step might be decoupling the main MiniProfiler class from the data source type used for profiling. Once that is done, we can add support for multiple simultaneous data sources.

---

<div class="post-metadata">

**Author:** ![Bryce\_Kahle](https://sea2.discourse-cdn.com/flex016/user_avatar/community.miniprofiler.com/bryce_kahle/32/1027_2.png) [@Bryce\_Kahle](https://community.miniprofiler.com/u/Bryce_Kahle)\
**Post date:** [July 18, 2012, 4:13pm UTC](https://community.miniprofiler.com/t/mongodb-support/151/9 "2012-07-18T16:13:03Z")

</div>

That way the mongo support can be an optional assembly since it depends on the mongo driver nuget package.
