Query C# Mongo object where array property matches value and return object without projection
I have an object like so:
MongoDB document does not map correctly to an object
QUESTION
MongoDB document does not map correctly to an object
QUESTION
MongoDB document does not map correctly to an object
QUESTION
MongoDB document does not map correctly to a C# object
QUESTION I am having the following problem with the DEMO CODE (below): When executing the line below… var customer = collection.Find(filter).FirstOrDefault(); …the following error… System.FormatException: An error occurred while deserializing the Header property of class Customer: Element ‘id’ does not match any field or property of class Header. —> System.FormatException: Element ‘id’ does not match […]
Get all keys in a dictionary
I have a collection of objects that contain a dictionary, and would like to extract only the keys and not the values in the dictionary (which are much larger than the keys, unlike in the example below) I am using MongoDb.Driver 2.10 for C#.
MongoDB driver Linq Last operation not supported
I am using MongoDB driver 2.19.0. In Mongo collection, document has 1 list of statuses and I want to sort all documents based on the last element of statuses list.
So sort query is
Unable to determine the serialization information for DateTime
I am trying to run mongoDB query in c#. I need to get records in descending order of UpdatedDate. UpdatedDate is stored in string format e.g. 9/9/2022 9:55:16 PM
MongoDB C# Sort based on conditionnal column
I have an entity with 2 dates, let assume this simplified entity: