diff --git a/backend-services/feed-service/app/repositories/DailyRepository.scala b/backend-services/feed-service/app/repositories/DailyRepository.scala index 612cc4fdd2d32349dca4667f400315158288367f..ad58133a90f2c8b57352fff402d850544513c726 100644 --- a/backend-services/feed-service/app/repositories/DailyRepository.scala +++ b/backend-services/feed-service/app/repositories/DailyRepository.scala @@ -38,6 +38,17 @@ class DailyRepository extends MongoDBClient { Await.result(futureCollection, 3.seconds) } + /** + * Gets a Daily record from the given ID. + * + * @return A Future containing a sequence of matching Daily objects. + */ + def getDaily(dailyId: ObjectId): Future[Daily] = { + val filter = Filters.equal("_id", dailyId) + val document: Future[Document] = find(dailiesCollection, filter).map(x => x(0)) + document.map(doc => DailyRepository.fromMongoDocument(doc)) + } + /** * Gets all the Daily records. *