Tagged Questions
31
votes
2answers
10k views
MongoDB GridFs with C#, how to store files such as images?
I'm developing a web app with mongodb as my back-end. I'd like to have users upload pictures to their profiles like a linked-in profile pic. I'm using an aspx page with MVC2 and I read that GridFs ...
24
votes
2answers
4k views
Update MongoDB field using value of another field
In MongoDB, is it possible to update the value of a field using the value from another field? The equivalent SQL would be something like:
UPDATE Person SET Name = FirstName + ' ' + LastName
And ...
22
votes
6answers
5k views
What is the most mature MongoDB driver for C#?
So, there are
mongodb-csharp
simple-mongodb
NoRM
as C# drivers for MongoDB available.
Which one of them is the most mature and stable one?
Why would you choose one over the other two?
Are they ...
18
votes
2answers
3k views
Convert string into MongoDB BsonDocument
I have a long string in JSON format, and I want to convert it into a BSONDocument for insertion into a MongoDB database. How do I do the conversion? I'm using the official C# driver.
14
votes
1answer
3k views
Unit of work in mongodb and C#
I know that MongoDB is not supposed to support unit of work, etc. But I think it would be nice to implement the repository which would store only the intentions (similar to criteria) and then commit ...
13
votes
5answers
1k views
What database systems should an startup company consider?
Right now I'm developing the prototype of a web application that aggregates large number of text entries from a large number of users. This data must be frequently displayed back and often updated. At ...
12
votes
1answer
4k views
How do you update multiple field using Update.Set in MongoDB using official c# driver?
The following code will allow me to update the Email where FirstName = "john" and LastName = "Doe". How do you update both Email and Phone without using Save() method?
MongoDB.Driver.MongoServer ...
11
votes
3answers
3k views
How to get the Mongo database specified in connection string in C#
I would like to connect to the database specified in the connection string, without specifying it again in GetDatabase.
For example, if I have a connection string like this;
...
11
votes
3answers
937 views
What is the right way to manage MongoDB connections in ASP.Net MVC?
What is the best practice for managing the MongoServer class life cycle? Should I create one and close it at the end of each request or should it be kept as a singleton for the entire life of the app ...
10
votes
2answers
4k views
How do I use SafeMode with the MongoDB C# driver
I found that some methods of the official MongoDB C# driver use SafeMode and return SafeModeResult. What is this SafeMode and how do I use it? It would be great to see some use cases - for example, a ...
10
votes
5answers
384 views
Converting data from Mongo to MySQL (110M docs, 60Gigs) - Tips and Suggestions?
I have been tasked with porting data from a MongoDB database to a MySQL database.
(There are strong reasons for porting - so it has to be done).
The MongoDB collection:
Has approx 110 Million ...
10
votes
4answers
1k views
Mongo Schema-less Collections & C#
I'm exploring Mongo as an alternative to relational databases but I'm running into a problem with the concept of schemaless collections.
In theory it sounds great, but as soon as you tie a model to ...
9
votes
3answers
1k views
Is there mongodb C# driver support System.Dynamic.DynamicObject in .NET 4?
Im working on a project that use .NET Razor and mongodb. I would like to do something like this:
@{
var feeds = DP.Database.GetCollection("feeds").FindAll();
}
<ul>
@foreach (dynamic ...
8
votes
2answers
4k views
Creating MongoDB Unique Key with C#
I am a total n00b with MongoDB and I am fighting to create a unique field EmailAddress. I've already seen in forums that I have to create an index, but it didn't work out for me so far. Does anyone ...
8
votes
2answers
3k views
How to find min value in mongodb
How do you do the equivalent of
SELECT
MIN(Id) AS MinId
FROM
Table
in MongoDB. It looks like I will have to use MapReduce but I can't find any example that show how to do this.
Thank you.