Package com.mongodb

Examples of com.mongodb.DBObject.toMap()


      public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException {

        for (DBObject indexInfo : collection.getIndexInfo()) {

          DBObject keys = (DBObject) indexInfo.get("key");
          Map<String, Object> keysMap = keys.toMap();

          for (String key : keysMap.keySet()) {
            Object indexType = keys.get(key);
            if (type.equals(indexType)) {
              return true;
View Full Code Here


    stage.setMode(Mode.valueOf((String)dbo.get(ACTIVE_KEY)));
    stage.setPropertiesModifiedDate((Date)props.get(PROPERTIES_DATE_SUBKEY));
    DBObject properties = (DBObject) props.get(PROPERTIES_MAP_SUBKEY);
    HashMap<String, Object> map = new HashMap<String, Object>();
    if(properties!=null) {
      map.putAll(properties.toMap());
    }
    stage.setProperties(map);
   
    return stage;
  }
View Full Code Here

    @Override
    public Set<String> getPropertyKeys() {
        Set<String> finalproperties = new HashSet<String>();
        DBObject element = getDBCollection().findOne(QueryBuilder.start(MONGODB_ID).is(id).get());
        Map<String, Object> elementmap = element.toMap();
        Iterator<String> propertiesit = elementmap.keySet().iterator();
        while (propertiesit.hasNext()) {
            String property = propertiesit.next();
            if (!property.startsWith("graph:") && (!property.startsWith("_id")) && (!property.equals(StringFactory.LABEL))) {
                finalproperties.add(MongoDBUtil.getPropertyName(property));
View Full Code Here

            }
           
          
            if (queryResult != null)
            {
                result.putAll(queryResult.toMap());
            }
            return queryResult != null ? 0 : 1;
        }
        catch (Exception e)
        {
View Full Code Here

            } else {
                queryResult = collection.findOne(q);
            }

            if (queryResult != null) {
                result.putAll(queryResult.toMap());
            }
            return queryResult != null ? 0 : 1;
        } catch (Exception e) {
            logger.error(e + "", e);
            return 1;
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.