mongodb-csharp

How to use MongoRegex (MongoDB C# Driver)

Has anyone have any idea how to use MongoRegex for the document search? I attempted this, but returns nothing back: var spec = new Document(); spec.Add("Name", new MongoRegex("/" + searchKey + "*/", "i")); collection.Find(spec) Wondering why it doesn't work, I tried to execute following command from the console: db.things.find({"Nam...

MongoDB, after redefining the class, Mongo ignores the insert or any action against that class

Guys, Have you ever been in this situation? Say, you define a class Student, and use it to store data into MongoDB Later, you modify the class Student and want to store data into MongoDB and then notice Mongo doesn’t actually insert the data. Has anyone know the reason why? It is not a radical change to the class, instead only adding ...

How can I use mongodb with linq for store large binary objects(files)?

I know two most popular C# drivers for mongodb, this are mongodb-csharp and NoRM. Both of them have some problems. For example, with mongodb-csharp I can't use full functional linq and with NoRM I can't store large file in mongodb. In my project, I need to use linq with large objects (files). ...

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 production ready? ...

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 the moment I store the content inside a MySQL database and use NHibernate ORM layer to interact with the DB. I've got a table defined for ...

Does any know if there is MongoDB-CSharp driver documentation?

I'm looking at using the MongoDB-CSharp driver for MongoDB on a small test project. The downloads have binary and source, but I can't find any documentation anywhere. Does anyone know if there's documentation for MongoDB-CSharp, or should I just be reading the source?? Thanks ...

Properly Abstract OId in MongoDB with MongoDB-CSharp

I'm trying to use MongoDB with my POCOs. Using mongodb-csharp library (http://github.com/samus/mongodb-csharp), I've got everything working, but I have to have my Ids set to OIds which requires me to reference the mongodb-csharp library from within my entities assembly. This doesn't seem right. I've searched online but I can't seem to fi...

Samus Mongodb-csharp Inserting Dates & Querying by Dates

I am using the MongoDB-Csharp driver and I was wondering what the proper way to insert and query date field? I tried using storing the dates using System.DateTime, but I am having issues when I try to query by date. example: Inserting Data var mongo = new Mongo(); var db = mongo.GetDatabase(dbName); var collection = db.GetCollection(...

C# MongoDB Driver With Support For Replica Sets

Hi. Is there a C# MongoDb Driver which supports replica sets? ...

How do I diagnose connection problems with MongoDB

Using the c# driver and MongoDB on windows server. Connection code looks like this: using (var mongo = new Mongo(ConnectionString)) { mongo.Connect(); //do stuff mongo.Disconnect(); } if ConnectionString == "mongodb://LocalHost/MyCollection" everything is fine if ConnectionString == anything else... doesn't work.....

Using MongoDB in a web environment efficiently

I'm approaching MongoDB from an NHibernate background and I want to know what the best practices are for efficient usage in a web context. With NHibernate, I create a single ISessionFactory for the life of the application, then use an instance of an ISession per request. Take the below code for example (which i hope is typical, please c...

mongodb-csharp driver - how to save a property as a reference rather than embedded?

We're doing a little spike on Mongo DB for our C#.NET project to see if it's right for us, and I've run into a little problem with the mongodb-csharp driver by samus that I'm not sure how to implement. Given the following simplified model: public class Campaign { public string Name { get; set; } public IEnumerable<Place...

cannot edit any value in this datagridview

i have a datagridview bould on a list from Mongodb. however i cannot edit the grid. I dunno why its like that? `var connstr = "Server=localhost:27017"; mongo = new Mongo(connstr); mongo.Connect(); IMongoDatabase TorontoTrader = mongo["TorontoTrader"]; IMongoCollection TradingStrategyCollection = Toronto...

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 the MongoDB pseudo-code would be: db.person.update( {}, { $set : { name : firstName + ' ' + lastName } ); ...

MongoDB Stored Procedure (javascript function) that updates documents before it returns them as results?

I'm in the process of converting a system from sql server to mongodb. I believe the project is a good candidate for mongodb, but that's not my question. In the sql database, i have a stored procedure that I use to return a set of records that need processing. So, I have Processed BIT and LastProcessingRequestDate DATETIME fields in th...

MongoDB: C# or JavaScript?

Hi! I am not deep in working with MongoDB. But i want to use it with C# driver. I guess that not all features can be available in this driver (Am i right?). Or for example, it easy to find some code written on javascript and, so, it seems easy to use it without mapping/finding appropriate methods in C# driver. I know that MongoDB is wri...