0

I have collection called "Person",after applying reactive find() on this collection ,it return the FindPublisher. How to iterate over this collections and get a list of a names .Here name is "column name". Person collection structure :

{ "name":"John", "age": 18 }

Prabhakar
  • 69
  • 2
  • 8

1 Answers1

0

You can try this if you have a POJO for Person collection

Flux.from(db.getCollection("Person").find(Person.class)).map(Person::getName)

This will give you a flux of String with all names.