CQ6AWLHKLF4KQCJPGBSF3AVHUKR2VH26IISD7VEL2E7Z7FAK6R7QC
7SSDATWD4YOCDC3UQKKJI5T7E6HM6E4DEA4BFUAM5LAIT5WHEWAQC
24OMXOPU7MP7SLFVDTZ5JHRNHSCZFJAXQBAXWWL6D2ZCDCH6POLAC
DIJO2HGF3PO7BSYOUZN2DMHU2SRR6CLQ245XKXSETZPJHF6RRKDAC
book_id = DB.create_book(book.title) DB.set_author(book_id, book.author)
book_id = DB.create_book(book.title)
DB.set_author(book_id, book.author)
book_id = DB.create_book(book.title, book.author)
def create_book(title) do
def create_book(title, author) do
MERGE (book:Book {title: $title})
MERGE (book:Book {title: $title, author: $author})
%{title: title}
%{title: title, author: author}
end def set_author(book_id, author) do Bolt.Sips.query!( Bolt.Sips.conn(), """ MATCH (book) WHERE id(book) = $id SET book.author = $author """, %{id: book_id, author: author} )
end
def set_author(book_id, author) do
Bolt.Sips.query!(
Bolt.Sips.conn(),
"""
MATCH (book)
WHERE id(book) = $id
SET book.author = $author
""",
%{id: book_id, author: author}
)