University of Massachusetts Lowell Cypher Code Query Project

Task 1: Adding or Updating a Movie

Suppose we do not know if we have the movie Rocketman in our graph. If it is not in the graph, we want to set the createdAt property with the value of datetime(). The datetime() function returns the current date and time. If it is in the graph, we want to set the matchedAt property with the value of datetime(). In either case, we want to set the updatedAt property with the value of datetime().

Modify the Cypher code to use MERGE processing for the Movie node with the title Rocketman:

If the node already exists (

ON MATCH

SET clause):

Set the matchedAt property for the node referenced by m to datetime().

If the node does not exist (

ON CREATE

SET clause):

Set the createdAt property to datetime().

For either case:

Set the updatedAt property to datetime().

Execute your code twice to ensure that the the MERGE processing occurs. That is, the newly created node will have a createdAt property and the updated node will have a matchedAt property. In both cases, the node will have the updatedAt property set

THE QUERY NEEDS TO LOOK LIKE THIS IN Neo4J

MERGE (m:Movie {title: ‘Rocketman’})

// perform the ON MATCH setting of the matchedAt property

// perform the ON CREATE setting of the createdAt property

// set the updatedAt property

RETURN m

I actually have the query below! But there is some issue with the node. Please help me fix it!

MERGE (m:Movie {title: ‘Rocketman’})ON MATCH

SET m.matchedAT = datetime(),

m.updatedAt = datetime()

ON CREATE

SET m.createdAt = datetime(),

m.updatedAt = datetime()

RETURN m.title, m.createdAt,m.matchedAt, m.updatedAt

Calculate your order
275 words
Total price: $0.00

Top-quality papers guaranteed

54

100% original papers

We sell only unique pieces of writing completed according to your demands.

54

Confidential service

We use security encryption to keep your personal data protected.

54

Money-back guarantee

We can give your money back if something goes wrong with your order.

Enjoy the free features we offer to everyone

  1. Title page

    Get a free title page formatted according to the specifics of your particular style.

  2. Custom formatting

    Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

  3. Bibliography page

    Don’t pay extra for a list of references that perfectly fits your academic needs.

  4. 24/7 support assistance

    Ask us a question anytime you need to—we don’t charge extra for supporting you!

Calculate how much your essay costs

Type of paper
Academic level
Deadline
550 words

How to place an order

  • Choose the number of pages, your academic level, and deadline
  • Push the orange button
  • Give instructions for your paper
  • Pay with PayPal or a credit card
  • Track the progress of your order
  • Approve and enjoy your custom paper

Ask experts to write you a cheap essay of excellent quality

Place an order