Examples of BasicDBList


Examples of com.mongodb.BasicDBList

     * @param greaterThanValue check to see if the field is > this value
     * @param lessThanValue check to see if the field is < this value
     * @return
     */
    public MatchAggregation greaterThanOrLessThan(String field, Object greaterThanValue, Object lessThanValue) {
        BasicDBList list = new BasicDBList();
        list.add(new BasicDBObject(field, new BasicDBObject("$gt", greaterThanValue)));
        list.add(new BasicDBObject(field, new BasicDBObject("$lt", lessThanValue)));
        ((BasicDBObject) match.get("$match")).append("$or", list);
        return this;
    }
View Full Code Here

Examples of com.mongodb.BasicDBList

            } else {
                // Fill in the metadata from the available node metadata

                // Get the IP address
                if (cMetadata.containsField("publicAddresses")) {
                    BasicDBList publicAddresses = (BasicDBList) cMetadata.get("publicAddresses");

                    // TODO: How do we want to handle multiple IP addresses?
                    if (publicAddresses.size() > 0) {
                        civMetadata.put("targetIP", publicAddresses.get(0));
                    }
                }

                // Get location information (ISO 3166 code, region and availability zone)
                if (cMetadata.containsField("location") && cMetadata.get("location") != null) {
                    BasicDBObject location = (BasicDBObject) cMetadata.get("location");
                    boolean regionProcessed = false;
                    boolean zoneProcessed = false;

                    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) {
                                case REGION:
                                    civMetadata.put("targetRegion", location.get("id"));
                                    regionProcessed = true;
                                    break;
                                case ZONE:
                                    BasicDBList iso3166Codes = (BasicDBList) location.get("iso3166Codes");

                                    civMetadata.put("targetISO3166Code", iso3166Codes.get(0));
                                    civMetadata.put("targetZone", location.get("id"));
                                    zoneProcessed = true;
                                    break;
                            }
                        }
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.