0
votes
0answers
13 views

Retrive a list of sub documents from MongoDb

I have a model that looks like this public class Event { public string Id { get; set; } public string Name { get; set; } public List<Person> Attendees { get; set;} } public class ...
0
votes
2answers
46 views

MongoDB embedded document indexing issue

I have data in a mongodb collection in the following format: { _id: ObjectId, Product: string, Modules: [ { StaticModuleId: Int64, Set: [ { ...
1
vote
3answers
128 views

Array intersection in MongoDB

Ok there are a couple of things going on here..I have two collections: test and test1. The documents in both collections have an array field (tags and tags1, respectively) that contains some tags. I ...
0
votes
0answers
54 views

How to test that a string field in a MongoDB document is not empty?

I am trying to get the number of documents that have a field with an empty string. This field, lets call it "Field_One" is present in all documents (so, to be clear, I am not trying to find if the ...
1
vote
2answers
658 views

Inheritance in MongoDb: how to request instances of defined type

This is how I used to utilize inheritance in Entity Framework (POCO): ctx.Anumals // base class instances (all instances) ctx.Anumals.OfType<Cat> // inherited class Cat's instances only ...
0
votes
1answer
137 views

MongoDb c# Linq query and return a collection's child objects

Say I have a typical customers and orders scenario. I have a collection of customers and each customer document has a list of orders. Now I want to query the customers where the order date is within ...
0
votes
2answers
215 views

MongoDB C# - update using custom strongly-typed objects not allowed?

I am trying to perform an update using strongly-typed objects. For example, public void setAppointmentPrefs(string UserName, IEnumerable<AppointmentInfo> info) { var query = new ...
0
votes
1answer
62 views

Filtering set of images from MongoDB

I have written some codes to store image files in MongoDB. Now I want to filter and retrieve some images from the mongoDB. I want to filter out some images which has some set of characters on the ...
0
votes
1answer
28 views

How to get a number of documents starting by a certain document in mongodb

Let's say, in mongo db, I have a collection like this: {_id: "A", Value: "1"} {_id: "B", Value: "2"} {_id: "C", Value: "3"} {_id: "D", Value: "4"} {_id: "E", Value: "5"} {_id: "F", Value: "6"} {_id: ...
0
votes
2answers
265 views

MongoDB C# Remove doesn't work

i have this code for removing an item froma a mongofb collation private MongoCollection<T> GetCollection() { connectionString = "mongodb://localhost/?safe=true"; server = ...
0
votes
1answer
431 views

Redirect output of mongo query to a csv file

I am using MongoDB 2.2.2 for 32-bit Windows7 machine. I have a complex aggregation query in a .js file. I need to execute this file on the shell and direct the output to a CSV file. I ensure that the ...
1
vote
2answers
140 views

MongoDB embedded document delete

I have been doing experiments on MongoDB. Collection are as follows(sample). Project this, in this class of 95th DeleteAlbum line have the function of. { "_id": { "$oid": ...
1
vote
1answer
84 views

Handling MongoDB schema changes

How do you deal with schema changes in production? Let's say i'm tampering with some classes in my C# project, adding a complicated property which consists of a Dictionary (Key(UInt16),Value(UInt16)) ...
0
votes
0answers
122 views

Join multiple collections on multiple keys using map reduce in Mongo DB.

I know a way to join multiple collections using a same key, and I thinks its not possible to join multiple collections on multiple keys but wondering anyone know a way to do it. Lets say I have a ...
0
votes
0answers
97 views

MongoDB C# driver crash on First() call

I am having issues with the latest MongoDB C# driver (v1.4.2.4500) crashing when I query this document: { "_id" : "4fdfe705b48c6b24dcab994a", "CreatedDate" : new Date("6/18/2012 19:42:13"), ...
0
votes
1answer
1k views

Updating a single element in a nested list with official C# MongoDB driver

I have a simple game with multiple rounds and I want to update the most recent round: class Game { public ObjectId Id { get; set; } public List<Round> Rounds { get; set; } } class ...
0
votes
1answer
148 views

How to query for multiple results in mongoDB

If I want to find documents for more than one query parameter(sorry if not using correct wording), how do I do this? i am using the c# driver. Example I want to find documents for both provider1 and ...
1
vote
1answer
988 views

How to query a sub document collection using MongoDB and C# driver

I have the following structure: public class ThreadDocument { public ThreadDocument() { Messages = new List<Message>(); Recipients = new List<Recipient>(); } ...