Questions tagged [mongodb-csharp-2.0]

Version 2.0 of the C# driver for MongoDB.

187 questions
0
votes
0 answers

Why is my embedded document collection not loading when using the Mongodb C# driver?

I have a simple class which has an array of documents in it. The C# objects and mappings are below. For some reason I the MongoDB driver isn't returning the embedded collection of documents when I find a user. I can edit the collection using…
BenCr
  • 5,991
  • 5
  • 44
  • 68
0
votes
3 answers

Convert MongoDB BsonTimestamp to C# DateTime

What is the proper way to convert a BsonTimestamp field to a C# DateTime type? This is for data in MongoDB's oplog collection and using the MongoDB C# driver.
GaTechThomas
  • 5,421
  • 5
  • 43
  • 69
0
votes
1 answer

Documents not expiring using TTL in mongodb 3.0 (.Net driver 2.0)

I have the following code. The EnsureIndexes is called by the constructor to make sure that a TTL index has been created on the _expireAt field. Then when a document is inserted by calling the AddOrUpdateItem method, it adds a future date to the…
Arif
  • 17
  • 1
  • 8
0
votes
0 answers

Facing Issue Mongo DB ConnectionString

Can Any body tell me how to write a connection string for MongoDB if credentional are as follows: Database Name - ABC, Server Name - DEF1,DEF2 UserName - ankur Password - ankur123 I have Created at My End…
-1
votes
1 answer

Serializing a BsonArray with C# driver

Problem: I have a Mongo document that includes two arrays. One of the arrays is large, with subdocuments. This one serializes with no problem. Another is a simple array of this type: staffgroups {"Tech","Sales"} This one will not serialize. I get…
-1
votes
2 answers

Use Filter Find $where for MongoDb C# driver new version

I need to execute the following MongoDB query using C# driver to execute a javascript function on a field of type "Code" and check data inside contains a guid asa a string: The mongodb query that works is…
Dio
  • 21
  • 1
  • 3
-1
votes
1 answer

How to create a query to get only N entries from a list in certain record in MongoDB and C#?

I need to get last 12 entries from ListOfItems of a Block whose Name is "corner": public class Block { public ObjectId Id { get; set; } public string Name; public List ListOfItems; } But since there can be many many items in…
Tar
  • 8,529
  • 9
  • 56
  • 127
1 2 3
12
13