Get the App
SLTechnology News&Howtos  ›  Database  › 

Mongodb indexes multiple columns through @ Indexes

Shulou Source: shulou.com Published: 2022-06-01 21:24:26 10月06日 Update

@ 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.

Tags: Index date tag comment user minus sign Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple vpn OPPO Reno NVidia