[JAVA-653] How to get a Single column from tha database ? Created: 27/Sep/12 Updated: 26/Dec/19 Resolved: 27/Sep/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Harshavardhan Konakanchi | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java API |
||
| Description |
|
I need to get a single column values which are distinct. My table has three fields & none of them is primary. id, segment, active. I had written the following code, but it returns a result of size '0'. DBObject target = new BasicDBObject(); List<String> result = targetList.distinct("id",target) The value of result.size() is 0 |
| Comments |
| Comment by Jeffrey Yemin [ 27/Sep/12 ] |
|
This sort of question is best addressed in our users group. You can start a conversation at https://groups.google.com/forum/?fromgroups#!forum/mongodb-user. |