thoughtAddict
Jun 8th, 2011, 09:25 PM
Did a google search and found a lot of non-Mongo responses. (Try explaining that sentence to someone in the 80's). Found this forum and can't find a definitive answer.
Can we use "distinct" in the current spring data document API?
Ie. I have a "posts" collection with entries similar to:
{
"_id" : ObjectId("4df02289cafacff33d560a2c"),
"content" : "9 Lorem ipsum dolor sit amet, Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"dateCreated" : "06/08/2011 18:31 PM",
"author" : "Tom Foolery",
"categories" : [ "News of the 1800's", "Technology" ],
"title" : "Review: 'uz200v2a758k' JS library.",
"postId" : "f9be8697-dfc3-4a10-8965-5192e630ed09"
}
Trying to find all distinct "categories" entries, like:
db.posts.distinct("categories");
Thanks.
Can we use "distinct" in the current spring data document API?
Ie. I have a "posts" collection with entries similar to:
{
"_id" : ObjectId("4df02289cafacff33d560a2c"),
"content" : "9 Lorem ipsum dolor sit amet, Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"dateCreated" : "06/08/2011 18:31 PM",
"author" : "Tom Foolery",
"categories" : [ "News of the 1800's", "Technology" ],
"title" : "Review: 'uz200v2a758k' JS library.",
"postId" : "f9be8697-dfc3-4a10-8965-5192e630ed09"
}
Trying to find all distinct "categories" entries, like:
db.posts.distinct("categories");
Thanks.