8000 Feature: add support to pass relationship properties to get_or_create and create_or_update batch operations · Issue #583 · neo4j-contrib/neomodel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature: add support to pass relationship properties to get_or_create and create_or_update batch operations #583
Open
@Wenzel

Description

@Wenzel

Hi,

I'm using get_or_create() class method to bulk create a set of nodes.

However, I also would like to pass additional relationship properties as well, like a date for example:

class PetsRel(StructuredRel):
    date = StringProperty()

class Dog(StructuredNode):
    name = StringProperty(required=True)
    owner = RelationshipTo('Person', 'owner')

class Person(StructuredNode):
    name = StringProperty(unique_index=True)
    pets = RelationshipFrom('Dog', 'owner', model=PetsRel)

bob = Person.get_or_create({"name": "Bob"})[0]
bobs_gizmo = Dog.get_or_create({"name": "Gizmo"}, relationship=bob.pets, rel_props=({"date": '01-01-2015"}))

What do you think ?

If we compare with py2neo, they separated the bulk operations into 2 functions:

Could you add support for that in the future ?

Bulb node insertion and merging is super useful, especially with a high-level OGM like Neomode.

Thanks for the support !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0