How to ask question regarding mongoDB

Peace be upon you!
I would like to know that how can we ask questions or post question to the community when we have problems in our development?

Hey @Noman_Mangalzai_N_A - Welcome to the community :wave:

I’d definitely recommend checking out the Getting Started with the MongoDB Community: README.1ST :slight_smile:

Regards,
Jason

1 Like

i need aggregate result of the below query –
if you see the Json results -
Two from “_id.sourceType”: “F5MgmtTmLtmVirtual”
And one from “_id.sourceType”: “F5MgmtTmLtmPool”

I need total of four records from this.
here we have to Unwind servers as well.
Fields in result :::

                                "virtual_hostname":"$_id.hostname",
                                "sourceType":"$_id.sourceType",
                                "virtual_name":"$name",
                                "virtual_address":"$address",
                                "virtual_port":"$port",
                                "virtual_enabled":"$servers.enabled",
                                "node_address":"$servers.address",
                                "node_name":"$servers.nodeName",
                                "node_port":"$servers.port",
                                "pool":"$pool",

After aggregation we should have four set of the above fields.
I was trying in https://mongoplayground.net/

[
  {
    "_id": {
      "hostname": "rflukf502",
      "ipAddress": "7.191.12.19",
      "name": "caremobile_prod_80_pool",
      "fullPath": "/Common/caremobile_prod_80_pool",
      "sourceType": "F5MgmtTmLtmPool"
    },
    "name": "caremobile_prod_80_pool",
    "fullPath": "/Common/caremobile_prod_80_pool",
    "clientMnemonic": "RFL_UK",
    "servers": [
      {
        "nodeName": "RFLUKSODRP01",
        "displayName": "RFLUKSODRP01.rfl_uk.cernuk.com",
        "enabled": true,
        "up": false,
        "address": "104.170.243.75",
        "port": "80",
        "dnsA": "RFLUKSODRP01.rfl_uk.cernuk.com"
      },
      {
        "nodeName": "RFLUKSODRP02",
        "displayName": "RFLUKSODRP02.rfl_uk.cernuk.com",
        "enabled": true,
        "up": false,
        "address": "104.170.243.76",
        "port": "80",
        "dnsA": "RFLUKSODRP02.rfl_uk.cernuk.com"
      }
    ],
    "lastUpdated": ISODate("2023-08-07T09:28:27.171Z"),
    "_class": "com.cerner.cts.oss.nethawk.engine.business.f5VipStatus.F5ConfigPool"
  },
  {
    "_id": {
      "hostname": "rflukf502",
      "ipAddress": "7.191.12.19",
      "name": "caremobile_prod_80_vs",
      "pool": "/Common/caremobile_prod_80_pool",
      "sourceType": "F5MgmtTmLtmVirtual"
    },
    "name": "caremobile_prod_80_vs",
    "address": "104.170.243.112",
    "port": "80",
    "pool": "/Common/caremobile_prod_80_pool",
    "clientMnemonic": "RFL_UK",
    "deviceGroup": [],
    "policiesNames": [],
    "isInternetVip": false,
    "lastUpdated": ISODate("2023-08-08T09:57:07.844Z"),
    "_class": "com.cerner.cts.oss.nethawk.engine.business.f5VipStatus.F5ConfigVirtual"
  },
  {
    "_id": {
      "hostname": "rflukf502",
      "ipAddress": "7.191.12.19",
      "name": "caremobile_prod_443_vs",
      "pool": "/Common/caremobile_prod_80_pool",
      "sourceType": "F5MgmtTmLtmVirtual"
    },
    "name": "caremobile_prod_443_vs",
    "address": "104.170.243.112",
    "port": "443",
    "pool": "/Common/caremobile_prod_80_pool",
    "clientMnemonic": "RFL_UK",
    "deviceGroup": [],
    "policiesNames": [],
    "isInternetVip": false,
    "lastUpdated": ISODate("2023-08-08T09:57:07.844Z"),
    "_class": "com.cerner.cts.oss.nethawk.engine.business.f5VipStatus.F5ConfigVirtual"
  }
]