Package com.mongodb

Examples of com.mongodb.BasicDBObject.removeField()


        dto.setType(inventoryItem.getType());

        // Prune any sensitive information from the payload
        if (!dto.isOwner()) {
            if (payload.containsField("adminPassword")) {
                payload.removeField("adminPassword");
            }
            if (payload.containsField("credentials")) {
                payload.removeField("credentials");
            }
        }
View Full Code Here


        if (!dto.isOwner()) {
            if (payload.containsField("adminPassword")) {
                payload.removeField("adminPassword");
            }
            if (payload.containsField("credentials")) {
                payload.removeField("credentials");
            }
        }

        dto.setPayload(payload);
View Full Code Here

          f.put(DocumentPojo._id_, updateId);
        }
       
        // Check if entities enabled       
        if ((null != l) && (!_s0_bGeoEnts && !_s0_bNonGeoEnts)) {
          f.removeField(DocumentPojo.entities_);
          l = null;
        }//TESTED
       
        // Check if events etc enabled
        if ((!_s0_bEvents && !_s0_bFacts && !_s0_bSummaries)) {
View Full Code Here

          l = null;
        }//TESTED
       
        // Check if events etc enabled
        if ((!_s0_bEvents && !_s0_bFacts && !_s0_bSummaries)) {
          f.removeField(DocumentPojo.associations_);                   
        }//TESTED       
        else if (!_s0_bEvents || !_s0_bFacts || !_s0_bSummaries || (null != _s0_assocVerbFilter)) {         
         
          // Keep only specified event_types
          BasicDBList lev = (BasicDBList)(f.get(DocumentPojo.associations_));
View Full Code Here

            _collection.remove(_updatingReducer.getDeletionQuery());
          }
          if (null != reduceId) {
            o.put("_updateId", _updatingReducer.getReduceId()); // (so we know when this was last created)           
          }
          o.removeField("_id"); // (so will get re-created on save)
          _collection.save( o );
        }//TESTED
        else {
          // if we've found the object then we need to do a reduce on it:
          if (null == _updatingReducer && !_updatingReduceNotPossible) {
View Full Code Here

    DBObject result = new BasicDBObject();

    converter.write(dbObject, result);

    result.removeField(DefaultMongoTypeMapper.DEFAULT_TYPE_KEY);
    assertThat(dbObject, is(result));
  }

  /**
   * @see DATAMONGO-324
View Full Code Here

    Address address = new Address("Foo", "0123", "Bar");
    ConvertingParameterAccessor accesor = StubParameterAccessor.getAccessor(converter, address);

    DBObject dbObject = new BasicDBObject();
    converter.write(address, dbObject);
    dbObject.removeField(DefaultMongoTypeMapper.DEFAULT_TYPE_KEY);

    org.springframework.data.mongodb.core.query.Query query = mongoQuery.createQuery(accesor);
    BasicDBObject queryObject = new BasicDBObject("address", dbObject);
    org.springframework.data.mongodb.core.query.Query reference = new BasicQuery(queryObject);
View Full Code Here

    Address address = new Address("Foo", "0123", "Bar");
    ConvertingParameterAccessor accesor = StubParameterAccessor.getAccessor(converter, "Matthews", address);

    DBObject addressDbObject = new BasicDBObject();
    converter.write(address, addressDbObject);
    addressDbObject.removeField(DefaultMongoTypeMapper.DEFAULT_TYPE_KEY);

    DBObject reference = new BasicDBObject("address", addressDbObject);
    reference.put("lastname", "Matthews");

    org.springframework.data.mongodb.core.query.Query query = mongoQuery.createQuery(accesor);
View Full Code Here

    }

    public Query getProjectionQuery(Class<?> pojoClass) {
        DBObject query = new BasicDBObject();
        putFieldNames(query, getSchemaNode(pojoClass));
        query.removeField("_id");
        return new ProjectionQuery(query);
    }

    private ObjectNode getSchemaNode(Class<?> pojoClass) {
        try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.