Reputation: 2597
I can retrieve the distinct values for a field using mongoDB query as,
db.context.distinct("context_name")
which results ["Restaurant", "School"]
My Mongo collection name is Context
and a document looks like,
{
"_id" : ObjectId("57ca8a45cadee6167c4d92ba"),
"_class" : "com.something.webappmongo.domain.Context",
"context_name" : "Restaurant"
}
Now I want to get result using this query from Spring framework (Spring Boot 1.4.0). I was using Jhipster.
How to do it in repository interface and resource class?
Upvotes: 2
Views: 1383