-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support access to attribute name to use it as value in projections #20
Comments
Just brainstorming some ideas here: What about a function called |
entries() function may work. How it will behave on array? Also, need to think if it will help in the following use case: |
There are many cases when you need to convert an attribute name into values. What ma help is to have a keys() function that returns an array of keys.
Use Case 1:
Objects described in Json where ID of the object is the key need to be converted into an array of objects where ID is the property.
For example:
{
“a”: {"prop": "value1"},
“b”: {"prop": "value2"}
}
Convert to:
[
{“_id”: “a”, "prop": "value1"},
{“_id”: “b”, "prop": "value2"}
]
Use Case 2:
Key-value pairs need to be expanded to objects. And it should work for the arbitrary number of attributes.
For example:
{
“name”: "Milk",
“price”: 1
}
Convert to:
[
{“prop”: “name”, "value": "Milk"},
{“prop”: “price”, "value": 1}
]
The text was updated successfully, but these errors were encountered: