google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

Add option to @Property for boolean to skip save on false #388

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a collection where 99% of the values of field "xyz" are false. I'd like 
to have an annotation like:

@Property(skipOnFalse=true) 

or something so that Morphia only persists the "xyz" field when it is true. 
That way I can do a sparse index on this field since I only every query where 
it "equal(false)".

Is this something that exists in other MongoDB libraries?

Original issue reported on code.google.com by nic%tran...@gtempaccount.com on 10 Mar 2012 at 8:52