use of com.mongodb.connection.QueryResult in project mongo-java-driver by mongodb.
the class OperationHelper method cursorDocumentToQueryResult.
private static <T> QueryResult<T> cursorDocumentToQueryResult(final BsonDocument cursorDocument, final ServerAddress serverAddress, final String fieldNameContainingBatch) {
long cursorId = ((BsonInt64) cursorDocument.get("id")).getValue();
MongoNamespace queryResultNamespace = new MongoNamespace(cursorDocument.getString("ns").getValue());
return new QueryResult<T>(queryResultNamespace, BsonDocumentWrapperHelper.<T>toList(cursorDocument, fieldNameContainingBatch), cursorId, serverAddress);
}
Aggregations