SET a dict
See original GitHub issueHello,
First off, thanks for this project. I started to write one today. Then stumbled upon this, and stopped mine.
How would I write:
CREATE (u:User) SET u = {props};
or
MATCH (u:User {username: {username}}) SET u += {props};
Thanks again!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Python - Dictionary - Tutorialspoint
Create a new dictionary with keys from seq and values set to value. 4, dict.get(key, default=None). For key key, returns value or default...
Read more >python - Making a set from dictionary values - Stack Overflow
For Python: set(d.values()). Equivalent on Python 2.7: set(d.viewvalues()). If you need a cross-compatible Python 2.7/3.x code:
Read more >Python Dictionary - GeeksforGeeks
Dictionary in Python is a collection of keys values, used to store data values like a map, which, unlike other data types which...
Read more >5. Data Structures — Python 3.11.1 documentation
List comprehensions provide a concise way to create lists. ... It is best to think of a dictionary as a set of key:...
Read more >Create a Dictionary in Python – Python Dict Methods
To create an empty dictionary, first create a variable name which will be the name of the dictionary. Then, assign the variable to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This latest release should be what you’re looking for.
https://github.com/emehrkay/Pypher#operators
I’m going to push to pypi soon
Great catch. This was something that I was meaning to implement, but has completely feel off of my radar.
It would be pretty easy to add support for setting a dict in python and returning the curly brace-structure in cypher. However, I remember seeing an example that looked something like
RETURN {.name}
and I not too sure how to handle it.If we start with something like:
What does that look like in cypher? Is it
SET u += {'name': $name_var, 'age': $age_var}
or something different? And what are the other permutations of that dict-like structure in cypher that we’d need to account for in python?It isn’t too difficult to add, I just want to make sure we get it right. I will check the documentation for more examples. Please drop some links if you have any.
Thanks
Edit: I found the map projections page in the documentation. I will work on adding this: https://neo4j.com/docs/developer-manual/current/cypher/syntax/maps/