DEV Community

Kiran Shahi
Kiran Shahi

Posted on

How to fetch collection of subdocument using mongodb C# driver?

1

I have following MongoDB document:

{
  "_id": {
    "$oid": "5fbfa0005c15aaf2eac69ba6"
  }
  "PostMedia": [
    {
      "FilePath": "http://localhost:8886/localhost44323/image/",
      "Filename": "img1.jpg",
      "Title": null,
      "Description": ""
    },
    {
      "FilePath": "http://localhost:8886/localhost44323/image/",
      "Filename": "img2.jpg",
      "Title": null,
      "Description": ""
    }
  ]
},
{
  "_id": {
    "$oid": "5fbfa0485c15aaf2eac69ba7"
  },
  "PostMedia": [
    {
      "FilePath": "http://localhost:8886/localhost44323/image/",
      "Filename": "img3.jpg",
      "Title": null,

Top comments (0)