apoc.convert.fromjsonmap read json string
i tried to do it

with apoc.convert.fromjsonmap(

'

[

{"id": "1", "parentid": "2",

"animal":

{

"cat": ["one", "two"],

"dog": []

}

},

{"id": "3", "parentid": "4",

"animal":

{

"cat": ["tt", ""],

"do…
the json fragment you have there is a json list, not a json map (notice the outermost square brackets). use apoc.convert.fromjsonlist()
yes using a jsonata expression

[{"id":"9f82063c.c6daf","type":"change","z":"4484ee28.caa3c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$count(msg.payload) + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":460,"wires":[["269a25ff.79887a"]]}]… The problem is the response from the server, not your JavaScript. I ran the following code in the console on your page:



```
$.getJSON('data.json', function(data) { 
    console.log(data); 
});

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

The result looks like this:



  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

 ![enter image description here](https://fooobar.com//img/b0b4666ec951695a00da8c82eb85e737.jpg)


As you can see, there is only one property in the returned object ( `mesta`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

, an array with three elements).


You can confirm this by [visiting the file directly`data.json`
  




 (adsbygoogle = window.adsbygoogle || []).push({});](https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=) . i have used deserilaisation json. resolved The problem is that your pair's closure must return two different types of objects: int if you ask for "con", and the next closure on the line if you ask for "crd".


Here's one possible implementation:


Use a speaker so you can come back.



```
public static Func<string, dynamic> Pair(int x, Func<string, dynamic> y)
{
    Func<string, dynamic> pair =
           (a) =>
           {
               if (a == "con") return x;
               if (a == "crd") return y;
               throw new Exception();
           };

    return pair;
}

public static void Print(Func<string, dynamic> pair)
{
    while (true)
    {
        var next = pair("crd");
        Console.WriteLine((next == null ? "-":"+") +"> " + pair("con"));
        if (next != null)
        {
            Console.WriteLine("|");
            pair = (x) => next(x);
            continue;
        }
        break;
    }
}

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```


  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

Test:



```
var pair = Pair(1,
            Pair(2,
                  Pair(3,
                        Pair(4, null))));

Print(pair);

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

output:



```
+> 1
|
+> 2
|
+> 3
|
-> 4

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
``` def render("show.json", %{user: user} = assigns) do

%{

data: render\_one(user, admin.userview, "user.json", assigns)

}

end

there’s no “implicit” assigns map, which all functions would automatically inherit somehow. you need to explicitly pass the assigns map onwards into rend… **IMPORTANT NOTE:** You have to **sort your data** first.







The part I didn't get is that in the example construction



```
groups = []
uniquekeys = []
for k, g in groupby(data, keyfunc):
   groups.append(list(g))    # Store group iterator as a list
   uniquekeys.append(k)

```

`k` is the current grouping key, and `g` is an iterator that you can use to iterate over the group defined by that grouping key. In other words, the `groupby` iterator itself returns iterators.


Here's an example of that, using clearer variable names:



```
from itertools import groupby

things = [("animal", "bear"), ("animal", "duck"), ("plant", "cactus"), ("vehicle", "speed boat"), ("vehicle", "school bus")]

for key, group in groupby(things, lambda x: x[0]):
    for thing in group:
        print("A %s is a %s." % (thing[1], key))
    print("")
    

```

This will give you the output:



> 
> A bear is a animal.  
> 
> A duck is a animal.
> 
> 
> A cactus is a plant.
> 
> 
> A speed boat is a vehicle.  
> 
> A school bus is a vehicle.
> 
> 
> 


In this example, `things` is a list of tuples where the first item in each tuple is the group the second item belongs to.


The `groupby()` function takes two arguments: (1) the data to group and (2) the function to group it with.


Here, `lambda x: x[0]` tells `groupby()` to use the first item in each tuple as the grouping key.


In the above `for` statement, `groupby` returns three (key, group iterator) pairs - once for each unique key. You can use the returned iterator to iterate over each individual item in that group.


Here's a slightly different example with the same data, using a list comprehension:



```
for key, group in groupby(things, lambda x: x[0]):
    listOfThings = " and ".join([thing[1] for thing in group])
    print(key + "s:  " + listOfThings + ".")

```

This will give you the output:



> 
> animals: bear and duck.  
> 
> plants: cactus.  
> 
> vehicles: speed boat and school bus.
> 
> 
> i think it’s just a file with a list of file paths comma separated with the label for that image:

/path/to/cat.png,285

/path/to/dog.png,207

/path/to/zebra.png,340 In order to correctly map you need to use the multi-map functionality.



```
 var points = this._db.Query<Point, Address, Point>("select p.Id, 'x' [Id], p.Address_City [City], p.Address_State [State] from Points p", (p, a) =>
            {
                p.Address = a;
                return p;
            }).ToList();

``` you can do that with a combination of split() and index(). for example like index(split([client name]," , "),1) and the result would be “4 corners animal hospital” From the [Library Reference](http://docs.python.org/2/library/stdtypes.html#set-types-set-frozenset):



> 
> The set type is mutable — the contents can be changed using methods like add() and remove().
> 
> 
>