I am new to ruby so I am sorry if this question has an obvious answer but I have not had much luck with this.
But I keep running into
uninitialized constant BSON::ObjectID (NameError)
I have the require
require 'mongo'
Then here is the piece of code that's throwing the error, collection of course points to a db.
#Insert and return the row.
def insert(row)
id = collection.insert row
collection.find_one(:_id => BSON::ObjectID.from_string(id.to_s))
end
I am totally at a loss for whats wrong here. seeing how ruby doesn't like me requiring bson before or after mongo.
Tried in 1.9.2 and 1.8.7