Wednesday 15 June 2011

java - morphia: can I index on a referenced field? -



java - morphia: can I index on a referenced field? -

i'm pretty reply no, figured check.

if have record references record, this:

public class account{ @id objectid id; long balance; @reference client customer; } public class customer{ @id objectid id; string name; address address @indexed long social; }

can create index based off of referenced value? instance if wish able index accounts social, can accounts given social quickly, can that?

if u wanted u utilize compund index

http://docs.mongodb.org/manual/tutorial/create-a-compound-index/#index-create-compound-index

in case db.account.ensureindex( { customer.id: 1, customer.name: 1, .... } )

java mongodb morphia

No comments:

Post a Comment