Skip to content

Instantly share code, notes, and snippets.

@davisp
Created April 21, 2021 17:28
Show Gist options
  • Save davisp/8fd879e63d988768949052e055225912 to your computer and use it in GitHub Desktop.
Save davisp/8fd879e63d988768949052e055225912 to your computer and use it in GitHub Desktop.
$ ./target/debug/examples/basic
>> {"select": "@", "from": {"json": [{"_id": "bar", "value": 1}, {"_id": "foo", "value": 2}]}}
{
"results": [
{
"_id": "bar",
"value": 1.0
},
{
"_id": "foo",
"value": 2.0
}
]
}
>> {"select": {"'new_id'": "_id", "'v'": "value"}, "from": {"json": [{"_id": "bar", "value": 1}, {"_id": "foo", "value": 2}]}}
{
"results": [
{
"new_id": "bar",
"v": 1.0
},
{
"new_id": "foo",
"v": 2.0
}
]
}
>> {"select": ["_id", "'thing'", "value"], "from": {"json": [{"_id": "bar", "value": 1}, {"_id": "foo", "value": 2}]}}
{
"results": [
[
"bar",
"thing",
1.0
],
[
"foo",
"thing",
2.0
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment