org.mongodb.morphia.Datastore.getDB()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中org.mongodb.morphia.Datastore.getDB()方法的一些代码示例,展示了Datastore.getDB()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datastore.getDB()方法的具体详情如下:
包路径:org.mongodb.morphia.Datastore
类名称:Datastore
方法名:getDB

Datastore.getDB介绍

暂无

代码示例

代码示例来源:origin: BlackLabs/play-morphia

/**
 * Return MongoDB DB instance
 *
 * @return
 */
public static DB db() {
  return ds().getDB();
}

代码示例来源:origin: groupon/DotCi

protected DBCollection getCollection() {
  return getDatastore().getDB().getCollection("deploy_keys");
}

代码示例来源:origin: groupon/DotCi

protected DB getDB() {
  return getDynamicBuildRepository().getDatastore().getDB();
}

代码示例来源:origin: groupon/DotCi

protected DBCollection getCollection() {
    return getDatastore().getDB().getCollection(COLLECTION_NAME);
  }
}

代码示例来源:origin: acmeair/acmeair

public String getMongoVersion(){
    return datastore.getDB().command("buildInfo").getString("version");
  }
}

代码示例来源:origin: protegeproject/webprotege

@Override
  @Nonnull
  public List<CollectionItem> list(@Nonnull CollectionId collectionId,
                   int skip,
                   int limit) {
    return datastore.getDB().getCollection("CollectionItemData")
         .find(new BasicDBObject(COLLECTION_ID, collectionId.getId()),
            new BasicDBObject(ITEM, 1))
            // Requires a later version of mongo db - disable for now.
//                 .setCollation(Collation.builder().locale("en").numericOrdering(true).build())
         .limit(limit)
         .skip(skip)
        .toArray()
        .stream()
        .map(dbObject -> (String) dbObject.get(ITEM))
        .map(CollectionItem::get)
        .collect(toList());
  }

代码示例来源:origin: BlackLabs/play-morphia

gridfs = new GridFS(MorphiaPlugin.ds().getDB(), uploadCollection);

代码示例来源:origin: org.mongodb.morphia/morphia

String entityName = entity.getClass().getName();
throw new MappingException(format("Could not map %s with ID: %s in database '%s'", entityName, id,
                 datastore.getDB().getName()), e);

代码示例来源:origin: org.mongodb.morphia/morphia

id = ref;
} else {
  collection = datastore.getDB().getCollection(dbRef.getCollectionName());
  id = dbRef.getId();

相关文章