Tips Mongodb dynamic query remove _class conditions

 

Recently doing generic template standard sample projects, in the use of spring data jpa Mongodb dynamic query substitution _class conditions.

Why did you do in fact well understood, the data is written to the database in this field. Accepted query classes also have this data. So it is possible matches.

But we actually need such a rare case. Writing nowhere in the case of a collection of very little data format. Usually each set corresponds to a fixed entity class.

Baidu first one, actually I found someone on the life cycle approach plus its own motion to deal with. Certainly should not feel like this, look at the source code and official documents, it really is a place to set directly.

 

 

Guess you like

Origin www.cnblogs.com/atliwen/p/10973848.html