Package com.mongodb

Examples of com.mongodb.BasicDBObject.containsField()


        BasicDBObject key1 = (BasicDBObject) indexInfos.get(1).get("key");
        BasicDBObject key2 = (BasicDBObject) indexInfos.get(2).get("key");

        assertTrue("No index on the field b", key1.containsField("b") && "-1".equals(key1.getString("b")));
        assertTrue("No index on the field a", key2.containsField("a") && "1".equals(key2.getString("a")));

        DBObject b = collection.findOne("testInsertAutoCreateCollectionAndURIIndex");
        assertNotNull("No record with 'testInsertAutoCreateCollectionAndURIIndex' _id", b);

        b = testCollection.findOne("testInsertAutoCreateCollectionAndURIIndex");
View Full Code Here


                    while (location != null) {
                        if (regionProcessed && zoneProcessed) {
                            break;
                        }

                        String locationScope = location.containsField("scope") ? location.getString("scope") : null;

                        if (locationScope != null) {
                            LocationScope scope = LocationScope.valueOf(locationScope);

                            switch (scope) {
View Full Code Here

                                    zoneProcessed = true;
                                    break;
                            }
                        }

                        location = location.containsField("parent") && location.get("parent") != null ?
                                (BasicDBObject) location.get("parent") :
                                null;
                    }
                }
View Full Code Here

                // Get OS name
                if (cMetadata.containsField("operatingSystem")) {
                    BasicDBObject operatingSystem = (BasicDBObject) cMetadata.get("operatingSystem");

                    if (operatingSystem != null) {
                        if (operatingSystem.containsField("family")) {
                            civMetadata.put("targetOS", operatingSystem.get("family"));
                        }
                    }
                }
            }
View Full Code Here

                for (InventoryItemResponseDTO inventoryItem : responseDTO.getInventoryItems()) {
                    BasicDBObject payload = inventoryItem.getPayload();

                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsAccessKeyId));
                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsSecretKey));
                    Assert.assertFalse(payload.containsField("adminPassword"));
                    Assert.assertFalse(payload.containsField("credentials"));
                }

            }
        }
View Full Code Here

                    BasicDBObject payload = inventoryItem.getPayload();

                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsAccessKeyId));
                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsSecretKey));
                    Assert.assertFalse(payload.containsField("adminPassword"));
                    Assert.assertFalse(payload.containsField("credentials"));
                }

            }
        }
    }
View Full Code Here

        dto.setExternalId(inventoryItem.getExternalId());
        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

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

        dto.setPayload(payload);
View Full Code Here

        advancedConfigurationDbo = (null != job.query) ? ((BasicDBObject) com.mongodb.util.JSON.parse(job.query)) : (new BasicDBObject());
      }
      catch (Exception e) {
        advancedConfigurationDbo = new BasicDBObject();
      }
      boolean esMode = advancedConfigurationDbo.containsField("qt") && !job.isCustomTable;
      if (esMode && !job.inputCollection.equals("doc_metadata.metadata")) {
        throw new RuntimeException("Infinit.e Queries are only supported on doc_metadata - use MongoDB queries instead.");
      }

      config.setBoolean("mapred.used.genericoptionsparser", true); // (just stops an annoying warning from appearing)
View Full Code Here

              boolean convertedAwayFromMinMax = false;
              if (null == idQueryElement) { // nice and easy, add _id range
                splitQueryQuery.put(DocumentPojo._id_, idRange);
                convertedAwayFromMinMax = true;
              }//TESTED
              else if (! splitQueryQuery.containsField(DbManager.and_)) { // OK we're going to just going to make life easy
                splitQueryQuery.remove(DocumentPojo._id_);
                splitQueryQuery.put(DbManager.and_, Arrays.asList(
                    new BasicDBObject(DocumentPojo._id_, idQueryElement),
                    new BasicDBObject(DocumentPojo._id_, idRange)));
                convertedAwayFromMinMax = true;             
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.