Reputation: 1
I'll admit I'm still new to Ruby and now mongoDB so i'm guessing i'm doing something dumb. For a test I have this code called tester.rb:
require 'Mongo_Mapper'
MongoMapper.database = "myTestDB"
class Person
include MongoMapper::Document
key :first_name, String
key :last_name, String
end
person = Person.new(:first_name => "FirstNameHere", :last_name => "LastNameHere")
person.save
I'll run that code with no errors. I jump over to mongoDB....my myTestDB has been created, yeah! But if i do "db.myTestDB.find()" I see nothing.... I tried "Person.create()" as well, nada...nothing stored.
I have no clue what I'm doing wrong.... ideas?
Thanks
Upvotes: 0
Views: 517
Reputation: 1551
I think you're calling your find() method wrong in your mongodb command line.
You can see what collections are in your db by running:
show collections
You should see something like:
system.indexes
people
If you see the "people" collection, you can then run:
db.people.find()
to see all of the records that are in that collection.
Hope this helps!
Upvotes: 2