title: Neo4j - What's the best way to check if multiple items are in the DB based on a set of ids
body: <p>I have a bunch of 1000 ids (like: "id1", "id2", "id3" ... "id100") of "items" that I get from 3rd party server. I have a user who owns already owns 10-50 "items" like below:</p>
  
  <pre><code>(user)-[:owns]-&gt;(:ITEM{id: "id1"}) 
  </code></pre>
  
  <p>Those 100 item ids from 3rd party server are random. I need to write a cypher query that tells how many of those 3rd party item a given user already owns.</p>
  
  <p>Currently I am doing:</p>
  
  <pre><code>MATCH (user{id:userId}-[:OWNS]-&gt;(i:ITEM) 
  WHERE i.id = "id1" || i.id = "id2" || i.id = "id3" ..... || i.id = i"d100"
  RETURN i
  </code></pre>
  
  <p>Is there a better approach?</p>
  
  <p>Please Note: The number of items owned by user might be in the 1000s, where as number of item ids from 3rd party is always constant (100). For a given user, all 100 items might be a match or 0 or 1. </p>