我从mongodb的用户集合中获取数据,我已将该帐户作为对象ID存储在用户集合中,我只想从我的db-data-config.xml遵循的每个用户的帐户中获得字段组织名称:>
<dataConfig>
<dataSource name="MyMongo" type="MongoDataSource" database="mytestdb" />
<document>
<entity processor="MongoEntityProcessor" name="user" collection="user" query="{'isDeleted':false}" transformer="MongoMapperTransformer">
<field column="Class" name="Class" mongoField="_class"/>
<field column="firstName" name="firstName" mongoField="firstName"/>
<field column="_id" name="_id" mongoField="_id"/>
<field column="lastName" name="lastName" mongoField="lastName"/>
<field column="email1" name="email1" mongoField="email"/>
<field column="jobTitle" name="jobTitle" mongoField="jobTitle"/>
<entity processor="MongoEntityProcessor" name="account" collection="account" query="{'_id' : '${user.account}'}" transformer="MongoMapperTransformer" >
<field column="orgName" name="orgName" mongoField="orgName"/>
</entity>
</entity>
帐户中的对象ID在用户集合中存储为帐户属性。 任何人都知道如何做到这一点。