I have such a query executable in the mongo shell:
db.devices.find({_id: {$gt: ObjectId("5fd931e00000000000000000")}})
And I want to write it down in spring boot reactive mongo data, my attempts looking like this were unsuccessful:
@Service
public class MongoService {
@Autowired
private final ReactiveMongoTemplate mongo;
public MongoService(ReactiveMongoTemplate mongo) {
this.mongo = mongo;
}
public Flux<Device> getObjectsByTimestamp(String timestamp) {
Query query = new Query(Criteria.where("_id").gt("5fd931e00000000000000000"));
return mongo.find(query, Device.class, "devices");
}
}