Rewriting my app from ruby/rails to javascript/express. Will mongodb suit my needs? -
my rails 3 database schema.rb looks this:
activerecord::schema.define(:version => 20110504034934) create_table "comments", :force => true |t| t.string "name" t.text "content" t.integer "post_id" t.datetime "created_at" t.datetime "updated_at" t.string "ancestry" end add_index "comments", ["ancestry"], :name => "index_comments_on_ancestry" create_table "posts", :force => true |t| t.string "name" t.string "title" t.text "content" t.integer "topic_id" t.datetime "created_at" t.datetime "updated_at" end create_table "topics", :force => true |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end end
the additions database user-related via openid. can mongodb handle this?
yes, mongodb can handle type of structure. note may want change structure of data. may want consider embedding comments
inside of posts
.
also take @ topics
. if topic name unique (it is), may want consider making _id
in mongodb.
if you're moving node / mongodb, you'll want check out mongoosejs.com. it's simple orm mongodb. may model data.
Comments
Post a Comment