java - Set index on embedded document in Mongodb -



java - Set index on embedded document in Mongodb -

i utilize mongodb + springdata. document looks like:

@entity @document(collection="mycollection") public final class infoitemmongodbdocument { @id private objectid id; @column private string name; @column @indexed private int isfixed = 0; @column private list<documentcopies> copy;

where documentcopies pojo. possible set additional index on 1 of documentcopies field using spring info annotations.

thanks lot!

yes, need "dot notation" form referencing field in other pojo indexed:

@document(collection="mycollection") @compoundindexes({ @compoundindex( name="copy.childfield", def="{'copy.childfield': 1}") })

where "childfield" name of "field/property" beingness indexed.

java spring mongodb spring-data

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -