[SERVER-9577] new deverloper question on usage of Aggregation Framework Created: 03/May/13 Updated: 24/Jun/13 Resolved: 06/May/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.4.0 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Minor - P4 |
| Reporter: | Craig Curtin | Assignee: | Linda Qin |
| Resolution: | Done | Votes: | 0 |
| Labels: | aggregation | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB shell version: 2.4.1 Linux |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
please see attached outlook email message. let me know if you can't open or if this is not a good medium for you. yep, i'm a n00b with Framework ... I've been through the online docs and I'm still doing something stupid. Help! |
| Comments |
| Comment by Craig Curtin [ 06/May/13 ] | |||||||||||||||||||||||
|
Linda, ah, you know what is like ... I'm new and hacking around a bunch of things to make something work. thanks for your help, Craig | |||||||||||||||||||||||
| Comment by Linda Qin [ 06/May/13 ] | |||||||||||||||||||||||
|
Hi Craig, You got the "invalid operator" error message because you tried to use the $last operator in the _id field. Per the documentation for the $last operator, you should use $last when the $group follows a $sort operation. To get the latest free memory percentage for each group, you can use the aggregation operation like this:
This will give you the following result:
Regards, | |||||||||||||||||||||||
| Comment by Craig Curtin [ 04/May/13 ] | |||||||||||||||||||||||
|
re-saved as text. Thanks, | |||||||||||||||||||||||
| Comment by Eliot Horowitz (Inactive) [ 04/May/13 ] | |||||||||||||||||||||||
|
Can you copy the content of the email as text? |