複数のフィールドを対象にユニークを付ける方法が全く分からなかったのですが、解決しましたので、メモを残しておきます。 やりたいこと やりたかったことは、 > db.collection.find() { "_id" : ObjectId("52721881fd0d0e71ffa8c31d"), "a" : 1, "b" : 1 } { "_id" : ObjectId("52721884fd0d0e71ffa8c31e"), "a" : 1, "b" : 2 } { "_id" : ObjectId("52721888fd0d0e71ffa8c31f"), "a" : 2, "b" : 1 } { "_id" : ObjectId("5272188bfd0d0e71ffa8c320"), "a" : 2, "b" : 2 } 上のようなフィールド "a" と "b" を持つコレクション co