Can I set a field value as object key in MongoDB?
I have a list of documents that looks like this: _id: ObjectId('63c6a4b858612f44f37d4771') type: "TypeA" priority: 1 _id: ObjectId('627279d3ba7aef5d6418c867') type: "TypeB" priority: 2 The type here is unique so I can't have two documents with the same type. Now I want…