@Override public final void requireMetadataFieldNotEquals(String s, Object o) { qb = putMetadataField(s).notEquals(o); getMetadataNotEquals().put(s, o); }
@Override public final void requireContentFieldNotEquals(String s, Object o) { qb = putContentField(s).notEquals(o); lq.requireContentFieldNotEquals(s, o); }
protected QueryBuilder buildIsNullQuery(IsNull obj, QueryBuilder query) { if (obj.isNegated()) { query.notEquals(null); } else { query.is(null); } return query; }
@Override public BasicDBObject getInstruction() throws TranslatorException { DBObject object = QueryBuilder.start(getDocumentName()).exists("true").notEquals(null).get(); //$NON-NLS-1$ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "{\"$match\": {"+object.toString()+"}}"); //$NON-NLS-1$ //$NON-NLS-2$ return new BasicDBObject("$match", object); //$NON-NLS-1$ } }
case NOT_EQUALS: if (operands.size() == 1) { builder.notEquals(operands.iterator().next()); } else { builder.notIn(operands);
@Override public boolean checkIfExistsBySocialSecurityNumber(String asId, String ssn) { if (!Strings.isNullOrEmpty(ssn)) { String encryptedSsn = shaEncrypter.encrypt(ssn.toUpperCase()); final DBObject query = QueryBuilder.start(FIELD_APPLICATION_SYSTEM_ID).is(asId) .and("answers.henkilotiedot." + SocialSecurityNumber.HENKILOTUNNUS_HASH).is(encryptedSsn) .and(FIELD_APPLICATION_OID).exists(true) .and(FIELD_APPLICATION_STATE).notEquals(Application.State.PASSIVE.toString()) .get(); return resultNotEmpty(query, INDEX_SSN_DIGEST); } return false; }
@Override public boolean checkIfExistsBySocialSecurityNumberAndAo(final ApplicationFilterParameters filterParameters, final String asId, final String ssn, final String aoId) { if (!Strings.isNullOrEmpty(ssn)) { String encryptedSsn = shaEncrypter.encrypt(ssn.toUpperCase()); DBObject query = QueryBuilder.start(FIELD_APPLICATION_SYSTEM_ID).is(asId) .and("answers.henkilotiedot." + SocialSecurityNumber.HENKILOTUNNUS_HASH).is(encryptedSsn) .and(FIELD_APPLICATION_OID).exists(true) .and(FIELD_APPLICATION_STATE).notEquals(Application.State.PASSIVE.toString()) .and(queryByPreference(filterParameters, Lists.newArrayList(aoId)).get()) .get(); return resultNotEmpty(query, INDEX_SSN_DIGEST); } return false; }
private QueryBuilder addStringCompQueryFilter(VariantQueryParam param, String key, String value, QueryBuilder builder) { String[] split = splitOperator(value); String op = split[1]; String obj = split[2]; switch (op) { case "!=": case "!": builder.and(key).notEquals(obj); break; case "~=": case "~": builder.and(key).regex(Pattern.compile(obj)); break; case "": case "=": case "==": builder.and(key).is(obj); break; default: throw VariantQueryException.malformedParam(param, value, "Unsupported operator " + op); } return builder; }
protected void buildComparisionQuery(Comparison obj, Object rightExpr, QueryBuilder query) { switch(obj.getOperator()) { case EQ: query.is(rightExpr); break; case NE: query.notEquals(rightExpr); break; case LT: query.lessThan(rightExpr); break; case LE: query.lessThanEquals(rightExpr); break; case GT: query.greaterThan(rightExpr); break; case GE: query.greaterThanEquals(rightExpr); break; } }
+ '.' + DocumentToStudyVariantEntryConverter.FILEID_FIELD); if (fileIdsFromSample.size() == 1) { negatedFileBuilder.notEquals(fileIdsFromSample.get(0)); } else { negatedFileBuilder.notIn(fileIdsFromSample);
@Override public void updateAllTimestamps(int time) { // 1) Update timestamp of clientSessions DBObject timestampSubquery = new QueryBuilder() .and("timestamp").notEquals(time).get(); DBObject query = new QueryBuilder() .and("clientSessions").elemMatch(timestampSubquery).get(); DBObject update = new QueryBuilder() .and("$set").is(new BasicDBObject("clientSessions.$.timestamp", time)).get(); // Not sure how to do in single query :/ int countModified = 1; while (countModified > 0) { countModified = getMongoStore().updateEntities(MongoOfflineUserSessionEntity.class, query, update, invocationContext); } countModified = 1; while (countModified > 0) { countModified = getMongoStore().updateEntities(MongoOnlineUserSessionEntity.class, query, update, invocationContext); } // 2) update lastSessionRefresh of userSessions query = new QueryBuilder().get(); update = new QueryBuilder() .and("$set").is(new BasicDBObject("lastSessionRefresh", time)).get(); getMongoStore().updateEntities(MongoOfflineUserSessionEntity.class, query, update, invocationContext); getMongoStore().updateEntities(MongoOnlineUserSessionEntity.class, query, update, invocationContext); }