I am trying to convert a Rails application to use mongodb through mongoid. I have two questions regarding indexes. I think I know the answer, but I want to get confirmation from someone who has more experience with the Mongod.
Take a look at the following example, where I have one relational relationship between Usersand Posts.
user.rb
class User
has_many_related :posts
end
post.rb
class Post
belongs_to_related :user
end
Now, when I look at indexes created through the MongoHQ interface, I notice the following two:
Keyword: _id_
Indexed field: _id
Unique: <blank>
Is the identifier unique? If so, then why is this not the only set. If not, how can I install this and do I need?
: user_id_1
: user_id
: false
, ? , , _1 .