MongoMucRelationContext.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:sissi 作者:
@Override
public Relation ourRelation(JID from, JID to) {
    AggregationOutput output = this.config.collection().aggregate(this.buildMatcher(to), this.unwindRoles, this.unwindAffiliation, BasicDBObjectBuilder.start().add("$match", BasicDBObjectBuilder.start().add(Dictionary.FIELD_ROLES + "." + Dictionary.FIELD_JID, from.asStringWithBare()).add(Dictionary.FIELD_ROLES + "." + Dictionary.FIELD_RESOURCE, from.resource()).get()).get(), this.projectRelation, this.match, this.sort, this.limit);
    @SuppressWarnings("deprecation")
    List<?> result = MongoUtils.asList(output.getCommandResult(), Dictionary.FIELD_RESULT);
    return result.isEmpty() ? new NoneRelation(from, to, this.affiliation(from, to)) : new MongoRelation(DBObject.class.cast(result.get(0)));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号