我正在考慮爲即將開展的項目使用node.js
工具,以便學習和提高性能。 For example,一些車型的Rails:什麼是Node.js世界中的ActiveRecord等價?
class User
has_many :topics
has_many :friends
has_many :friend_users, :through => :friends
has_many :friend_topics, :through => :friend_users, :source => :topics
end
class Friend
belongs_to :user
belongs_to :friend_user, :class_name => "User",
:foreign_key => :phone_no, :primary_key => :phone_no
end
class Topic
belongs_to :user
end
讓優雅的查詢代碼,如:
latest_10_topics_from_friends = current_user.friend_topics.limit(10)
,並生成優化的SQL。 node.js
生態系統中是否有類似的東西?
您正在使用什麼數據庫? – 2012-07-09 16:21:09
最有可能是mysql或postgre。 – ohho 2012-07-10 02:42:33
查看http://sailsjs.org – 2015-04-07 18:51:04