-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I use an object as a keyselector in a groupBy #65
Comments
Hi. I'm not sure I understand what you mean. Could you give an example of how you'd want to use groupBy? |
@tomi - I am also interested in doing this. Here is an example of what I am trying to do. This uses the example data at https://tomi.github.io/fromfrom/playground.html import { from } from "fromfrom";
import data from "data";
from(data)
.groupBy(d => ({"c": d.country, "g": d.gender}))
.map(d => ({"c": d.key.c, "g": d.key.g, "count": d.items.length}))
.toArray() Basically I want the number of elements in the sequence for every
Is there a way to accomplish this? Thanks in advance for your help and for your great work on this incredible project! |
Internally uses JSON.stringify to "hash" the object and use the hash for equality. I assume this is sufficient and faster than doing a deep equals check on the object, as JSON.stringify and JSON.parse are generally fast. implements #65
Internally uses JSON.stringify to "hash" the object and use the hash for equality. I assume this is sufficient and faster than doing a deep equals check on the object, as JSON.stringify and JSON.parse are generally fast. implements #65
Awesome! Thank you very much @tomi. |
Doesn't seem to work when I do this
The text was updated successfully, but these errors were encountered: