question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello,

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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
emehrkaycommented, Apr 25, 2018

This latest release should be what you’re looking for.

https://github.com/emehrkay/Pypher#operators

I’m going to push to pypi soon

1reaction
emehrkaycommented, Apr 24, 2018

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:

p.SET.u += {'name': 'some name', 'age' 999}

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/

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found