I'm working with MongoDB using Ruby.
I am able to query a document by doing something like this:
client[:inventory].find({"owner": identity}, projection: {"_id": 0, "group": 1}).each do |doc|
#Finds and returns a BSON document matching the query.
puts doc.to_s
end
However this gives the following key/value pair in String representation:
{"name" => "john"}
How would I retrieve only the value from the returned BSON document, removing the braces and hash rocket, in this case john?