N
N
Nikita Kamenev2021-08-19 13:07:49
JavaScript
Nikita Kamenev, 2021-08-19 13:07:49

How to get the value of an element?

{
    "_id": {
        "$oid": "611d7cd49db565e2890563d4"
    },
    "url": "example.com",
    "results": {
        "urls": {
            "http://exampe.com/": {
                "status": {
                    "$numberInt": "301"
                }
            },
            "https://example.com/": {
                "status": {
                    "$numberInt": "200"
                }
            }
        },
        "technologies": [{
            "slug": "sentry",
            "name": "Sentry",
            "confidence": {
                "$numberInt": "100"
            },
            "version": null,
            "icon": "Sentry.svg",
            "website": "https://sentry.io/",
            "cpe": null,
            "categories": [{
                "id": {
                    "$numberInt": "13"
                },
                "slug": "issue-trackers",
                "name": "Issue trackers"
            }]
        }, {
            "slug": "salesforce",
            "name": "Salesforce",
            "confidence": {
                "$numberInt": "100"
            },
            "version": null,
            "icon": "Salesforce.svg",
            "website": "https://www.salesforce.com",
            "cpe": null,
            "categories": [{
                "id": {
                    "$numberInt": "53"
                },
                "slug": "crm",
                "name": "CRM"
            }]
        }
    }
}


The collection consists of such elements. How do I get all entries where results->technologies->categories='crm'?
If we take into account that not all elements have results->technologies, somewhere it will be an empty array.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question