0

I have retrieved the following JSON from MongoDB using PyMongo. Some fields like filepath are unique for each object.

[
    {
        "_id": {
            "$oid": "614c342ad3c1c8e2945c8668"
        },
        "album": "Come Over When You're Sober, Pt. 2",
        // some other fields
        "filepath": "/music/.../....flac"
    },
    {
        // some other objects
    },
    {
        "_id": {
            "$oid": "614c342dd3c1c8e2945c8c8c"
        },
        "album": "Come Over When You're Sober, Pt. 2",
        // some other fields
        "filepath": "/videos/...mp3"
    }
]

I want to remove duplicates from this list by checking the album fields for each object.

How can I achieve this?

0 Answers0