@Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { lastMatch = false; LOGGER.debug("Evaluating array projection for {}, arrayField={}", p, arrayFieldPattern); // Is this field pointing to an element of the array // It is so if 'p' has one more element than 'arrayFieldPattern', and // if it is a matching descendant if (p.numSegments() == arrayFieldPattern.numSegments() + 1 && p.matchingDescendant(arrayFieldPattern)) { Projection.Inclusion ret = projectArray(p, ctx); LOGGER.debug("Projecting array element {}:{}", p, ret); lastMatch = ret == Projection.Inclusion.implicit_inclusion || ret == Projection.Inclusion.explicit_inclusion; return ret; } return Projection.Inclusion.undecided; }
@Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { lastMatch = false; LOGGER.debug("Evaluating array projection for {}, arrayField={}", p, arrayFieldPattern); // Is this field pointing to an element of the array // It is so if 'p' has one more element than 'arrayFieldPattern', and // if it is a matching descendant if (p.numSegments() == arrayFieldPattern.numSegments() + 1 && p.matchingDescendant(arrayFieldPattern)) { Projection.Inclusion ret = projectArray(p, ctx); LOGGER.debug("Projecting array element {}:{}", p, ret); lastMatch = ret == Projection.Inclusion.implicit_inclusion || ret == Projection.Inclusion.explicit_inclusion; return ret; } return Projection.Inclusion.undecided; }
@Override public Boolean project(Path p, QueryEvaluationContext ctx) { decidingProjector=null; lastMatch = false; if (p.matchingPrefix(arrayFieldPattern)) { decidingProjector=this; return include ? Boolean.TRUE : Boolean.FALSE; } // Is this field pointing to an element of the array // It is so if 'p' has one more element than 'arrayFieldPattern', and // if it is a matching descendant if (p.numSegments() == arrayFieldPattern.numSegments() + 1 && p.matchingDescendant(arrayFieldPattern)) { Boolean ret=projectArray(p, ctx); if(ret!=null&&nestedProjector!=null) { decidingProjector=nestedProjector.getDecidingProjector(); } return ret; } return null; }