0

I loaded my dataset by csv file name moviestoactors.csv with this particular command

LOAD CSV FROM 'file:///desktop-csv-import/moviestoactors.csv' AS row
WITH row[0] AS movieId, row[1] AS actorId, row[2] AS as_character, row[3] AS leading
MERGE (m:moviestoactors {movieId:movieId })
SET m.actorId = actorId, m.as_character = as_character, m.leading = leading
RETURN count(m)

The first problem i faced was that i was not able to load actorId as toInteger(row[1]) as actorId since it was showing syntax error like it is out of bound since the value of integer is too much large for integer to handle, and i did not find any solution for that so i decided to load actor id as string. Now if i want to match some id with anysort of id, i am not able to i dont know what is it but it is not working properly even though i checked my csv file and it had that id 9 times, for instance this is actorId 244663, this is my query which is not working, what should work then?

MATCH(ma:moviestoactors)
WITH ma.movieId AS movieId WHERE ma.actorId = '244663'
return movieId

To summarize the whole thing, first problem is how to get my id to be in integer form and the second thing if it is not in integer why it is not even matching in string form.

Huwaiza
  • 77
  • 2
  • 13
  • Your query doesn't implement what you want. The following can be helpful `MATCH(ma:moviestoactors) WHERE ma.actorId = '244663' return ma.movieId`. And 'toInteger' method should convert the above integer to int type, share the error that you get when you try to convert that can be helpful. – Pradeep Kumar Nalluri Jan 30 '20 at 10:48
  • LOAD CSV FROM 'file:///desktop-csv-import/directors.csv' AS row WITH toInteger(row[0]) AS directorId, row[1] AS firstName,row[2] AS lastName, toFloat(row[3]) as rate, row[3] as gross, toInteger(row[5]) as num MERGE (d:Director {directorId: directorId}) SET d.firstName = firstName, d.lastName = lastName, d.rate = rate, d.gross= gross, d.num = num RETURN count(d) This was the query and error is Neo.ClientError.Statement.SemanticError: Cannot merge node using null property value for directorId – Huwaiza Jan 30 '20 at 10:58
  • this error means some rows doesnt have values – TheTeacher Jan 30 '20 at 14:16
  • No it does not clearly – Huwaiza Jan 31 '20 at 12:06

0 Answers0