我有两个用MongoDB Grails PLUGIN映射的类:
班级人:
class Person {
static mapWith="mongo"
String name
String email
static hasMany = [profiles: Profile]
static belongsTo = Profile
String toString(){
return name +" - " + (profiles)
} }
和班级简介:
class Profile{
static mapWith="mongo"
String abbreviation
String description
static hasMany = [people: Person]
String toString(){
return abbreviation + " - " + description
}}
如何使用 mongo 提供的查找器进行查询以根据个人资料返回人员?
mongo 查询也可能有用!
此查找器不返回任何内容
def people = Profile.findAllByAbbreviation("example").people
对不起英文...