1

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?

Anamika
  • 75
  • 1
  • 8
  • 1
    Does this answer your question? [Convert object to map in java](https://stackoverflow.com/questions/52406467/convert-object-to-map-in-java) – Nikolai Shevchenko Feb 28 '22 at 12:32

0 Answers0