Skip to content

yongshun950824/MongoDBConsoleApp

Repository files navigation

MongoDBConsoleApp

Written Solutions for StackOverflow questions.

Reason to contribute:

  • Providing (reading) shortcut for referring questions and its solution source code.

Structure:

  • Program.cs: Entry point for calling the solution methods
  • ISolution.cs: An interface for Solution class.
  • Solution_XXX.cs: A class file which implements ISolution and with the written answer.
  • Data/Solution_XXX_<Collection?>.json: Sample data collection for Solution class.

Solutions and Linked question:

File Question
Solution_001 MongoDB .Net Driver - Filter Builder throwing an exception
Solution_002 MongoDB .Net Driver - Pull multiple elements from arrays that exist in multiple documents
Solution_003 Query with filter builder on nested array using MongoDB C# driver with a given array of string
Solution_004 MongoDB .NET Driver - StartsWith & Contains with loosely typed data
Solution_005 MongoDB Driver Builders<dynamic> dont work on equal to date
Solution_006 MongoDB .NET Driver - Pagination on array stored in a document field
Solution_007 How to Filter and get last entry based on date using C# and Mongo
Solution_008 Retrieving list of documents from collection by id in nested list
Solution_009 No array filter found for identifier '-1'
Solution_010 Filter.Lte(x=>x.Price, "9") getting wrong results
Solution_011 Rename nested field in BsonDocument with MongoDB.Driver
Solution_012 MongoDB .Net Driver update Cannot use the part ... to traverse the element
Solution_013
Solution_014 MongoDB.NET Driver query for $lte and $gte throwing error: An object representing an expression must have exactly one field
Solution_015 Convert lambda expressions to json objects using MongoDB.Driver
Solution_016 How to write this MongoDB (Aggregate) query into C#
Solution_017 Issue with data return in MongoDB
Solution_018 C# MongoDB - How to select nested properties only
Solution_019
Solution_020 MongoDB - How to push an embedded array into an existing document
Solution_021 c# and mongodb include or exclude element of array using projection
Solution_022 MongoDB C# Driver: Nested Lookups - How do I "join" nested relations?
Solution_024 How can I flatten this array of subdocuments?
Solution_025 How to "aggregate" with "project.priority" in MongoDB query in C#?
Solution_026 How to perform like on MongoDB document for integer values
Solution_027
Solution_028 MongoDB - Count unread messages
Solution_029 Find lastly added collection with some condition in MongoDB and C#
Solution_030 C# Searching MongoDB string that starts with "xyz"
Solution_031 MongoDB LINQ - How get all keys in all level in a collection
Solution_032 MongoDB .NET Driver - Increment a value inside dictionary
Solution_033 MongoDB - Search a field of type BsonDocument by their values
Solution_034 MongoDb return filtered array elements out of one document in C#
Solution_036 MongoDB .NET Driver - Aggregate group and count
Solution_037 How to IndexKeysDefinitionBuilder change to IndexKeysDefinition (MongoDB in C#)
Solution_038 MongoDB - How to update a single object in the array of objects inside a document
Solution_039 MongoDB - Query max date in collection
Solution_041 MongoDB .NET Driver - Count and average on lookup field
Solution_042 MongoDB - Cannot create field 'ChildProperty' in element with ParentProperty is null
Solution_043 MongoDB .NET Driver - How to push an element into an array which is inside an array
Solution_045 .Net Core MongoDB.Driver ObjectId Null from POCO Mapping
Solution_046 MongoDB .NET Driver - Update Item in Set
Solution_047 MongoDB .NET Driver - How to search the document(s) with fulfilling in the nested documents of an array
Solution_048 MongoDB - Get all elements inside a BsonArray and convert into List<string>
Solution_049 MongoDB .NET Driver - Using ElemMatch with FilterDefiniton
Solution_050 In MongoDB C# how to get nested array to perform aggregation query on it
Solution_051 MongoDB .NET Driver - Using pullFilter to remove string from string array
Solution_052 MongoDB .NET Driver - Aggregation query with calculation based on category
Solution_053 MongoDB .NET Driver - How to access nested element
Solution_055 newbie to CosmoDB how to query collection with multiple values?
Solution_056 MongoDB C# driver - Filter list of array based on specific item id
Solution_057 Cannot dynamically create an instance of type 'System.Text.Json.Nodes.JsonObject'. Reason: No parameterless constructor defined
Solution_058 MongoDB C#/.NET Driver - How to deserialize UUID and ISODate
Solution_059 MongoDB - How do I join the second collection to a child document using LINQ
Solution_060 Increment all fields of a MongoDB document from c#
Solution_061 MongoDB .NET Driver - How to increment double nested field
Solution_062 MongoDB - Select rows by their sequence number in one query
Solution_063 How to filter a collection for nested objects with different types
Solution_064 Using $toLong in MongoDB C# Queries
Solution_065 MongoDB .NET Driver - $lookup result to one merged & grouped array
Solution_068 How to filter using FHIR Identifiers from C# to mongoDB
Solution_069 MongoDB - How to query with multiple AND conditions for phone numbers using FilterDefinition
Solution_070 How to check last element's property of an array using MongoDB C# driver
Solution_071 Serialization inside Mongodb driver filter
Solution_072 MongoDB C# Property serializing with string and int value for query
Solution_073 MongoDB C# Driver: Convert time buckets to a dictionary with key as bucket's time
Solution_074 How to update different fields based on conditions in single call
Solution_075 MongoDB query to transform documents
Solution_076 Problem reading MongoDB data as name + value
Solution_077 Delete and return document in nested array with mongodb c# driver
Solution_078 Dotnet API Error Type System.Text.Json.JsonElement is not configured as a type that is allowed to be serialized for this instance of ObjectSerializer
Solution_079 MongoDB .NET Driver - Update field in nested sub array document
Solution_080 MongoDB Issues with translating JS query to C#
Solution_081
Solution_082 How to perform operations on Grandchild using Builders?
Solution_083 MongoDB - How to filter and update on a child of a child
Solution_084 MongoDB document does not map correctly to an object
Solution_085 How to filter on an array of objects that equals name and contains value?
Solution_086 MongoDB C# - How to do sorting and pagination with an array of objects on a record

About

Solution for StackOverflow questions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages