Ich habe CSV-Datei in Neo4j-Datenbank importiert. Ein Teil des Codes sieht so aus:Verbinden von Knoten von Neo4j mit Schienen
LOAD CSV WITH HEADERS from "file:///AccountTry.csv" as row
WITH row, split(row.birth_date, '-') as date
CREATE (a:AccountTest {id: toInteger(row.id), account_type: row.account_type, first_name: row.first_name, last_name: row.last_name })
und das funktioniert gut. Ich kann alle meine Knoten und ihre Attribute im neo4j Browser sehen. Dann erstellt i Modell in Rails-Anwendung:
class AccountTest
include Neo4j::ActiveNode
property :first_name, type: String
property :id, type: Integer
property :last_name, type: String
property :account_type, type: String
end
Ich machte die Migration und das funktioniert gut. Wenn ich die Rails-Konsole öffne und "AccountTest.first" versuche, bekomme ich alle Attribute gut, nur Property "AccountTest.id: nil".
Warum ist "id" null? Ich habe 6 Knoten und alle von ihnen in Schienen Anwendung haben ID = Nil, aber in Neo4j Browser haben alle von ihnen korrekte IDs.
In Neo4j Datenbank Ich habe zwei „id“ s: - Hexe von Neo4j gemacht wird, id - aus relationaler Datenbank, die ich aus dem Import CSV-Datei bekam (ich brauche, dass man) –