How to just get the parent "name" with LINQ style?
Open
Nobody has claimed this yet.
question
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 324
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 30
Description
Hi, my json like:
{ "name": "joe",
"children": [
{
"name": "Mary",
"age": 5
},
{
"name": "Mazy",
"age": 3
}
]
}
I want to get just parent name, how should I do?
if I do
val json = parse("""
{ "name": "joe",
"children": [
{
"name": "Mary",
"age": 5
},
{
"name": "Mazy",
"age": 3
}
]
}
""")
val t = json \\ "name "
This would give me all the list of name instead of just give me parents name.
res1: org.json4s.JValue = JObject(List((name,JString(joe)), (name,JString(Mary)), (name,JString(Mazy))))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source file, test, or entry point; it only provides a JSON example and a json4s query. Start by reproducing the query and checking the project’s query/operator documentation, with completion defined as a tested way to select only the root name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100