private TreeItem<DbTreeValue> createDbItem(MongoDatabase d) { return new DynamicTreeItem( new DbTreeValue(d, d.getName(), TreeValueType.DATABASE), new FontAwesomeIconView(FontAwesomeIcon.DATABASE), executor, popupService, this::buildDbChilds); }
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)); }
@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(); }