I have a piece of code.
List<Bson> results = queryBuilder.createQuery(request, tableName, pivotValues);
Publisher<Employee> rows = getCollection().aggregate(results);
Flux.from(rows).map().collect(Collectors.toList());
inside map() function - I need to write a lambda expression to convert the Employee object to Map<String, Object> - String Key is field name and Object is field value. Employee has fields id and name.
Can someone help on this?