Mongodb indexes multiple columns through @ Indexes
@ Indexes index annotations can be marked on a class so that multiple columns can be indexed
@ Entity
@ Indexes (@ Index ("user,-date"))
Public class ChangeLog {
Date date
String user
Record changedRecord
}
Note: the minus sign before "date" indicates the descending order of dates, which makes it easy to find the nearest user.