Ejemplo n.º 1
0
 private TreeItem<DbTreeValue> createDbItem(MongoDatabase d) {
   return new DynamicTreeItem(
       new DbTreeValue(d, d.getName(), TreeValueType.DATABASE),
       new FontAwesomeIconView(FontAwesomeIcon.DATABASE),
       executor,
       popupService,
       this::buildDbChilds);
 }
Ejemplo n.º 2
0
  public ObjectListPresentation explain() {
    MongoCollection<Document> collection = getCollection();

    FindIterable findIterable =
        new FindIterable(
            new MongoNamespace(mongoDatabase.getName(), collectionName),
            collection.getCodecRegistry(), //
            collection.getReadPreference(),
            getExecutor(),
            findQuery,
            findOptions);

    BsonDocument res = findIterable.explainIterator(ExplainVerbosity.QUERY_PLANNER);
    return JsApiUtils.singletonIter(JsApiUtils.convertBsonToDocument(res));
  }
Ejemplo n.º 3
0
  @JsIgnore
  @Override
  public MongoCursor<Document> iterator(int skip, int limit) {
    MongoCollection<Document> collection = getCollection();

    findOptions.skip(skip);
    findOptions.limit(limit);
    if (projection != null) {
      findOptions.projection(projection);
    }
    if (sort != null) {
      findOptions.sort(dbObjectFromMap(sort));
    }
    return new FindIterable(
            new MongoNamespace(mongoDatabase.getName(), collectionName),
            collection.getCodecRegistry(), //
            collection.getReadPreference(),
            getExecutor(),
            findQuery,
            findOptions)
        .iterator();
  }