Skip to content

Instantly share code, notes, and snippets.

# Week 09
# Last week we built our first class.
#
# Remember, in Ruby, we usually group data and functions together into
# things we call "objects".
#
# An object, is a specific example of a "class". For example, Fred might
# be an object from the class Person.
@ctford
ctford / neo_loading.rb
Created June 10, 2012 16:23 — forked from mneedham/neo_loading.rb
Loading stuff into neo via the batch API
# So the problem is inserting data into neo using the batch API. So we have a bunch of people and we want to put them into the graph and also
# add to to the index so that we can search for them.
# The way the batch API works is that you can refer to previous commands by referencing their index in the list of commands (zero indexed)
# e.g. if I want to reference the person added in the first command I would reference that node as {0}
# You should be able to see how that works in the code below.
neo_people_to_load =
[{ :name => "Mark Needham", :id => 1 },
{ :name => "Jenn Smith", :id => 2 },
{ :name => "Chris Ford", :id => 3 }]