MongoDB mongoid 自定义数据类型

sforce100 · October 25, 2012 · Last by ruby_sky replied at October 25, 2012 · 2358 hits

怎么做自定义数据类型呢

field :tags, type: Array, default: [] field :setting, type: Hash, default: {} field :admin, type: Boolean, default: false

#1 楼 @HungYuHei 如果我想做一个"a":[{x:x,c:c,v:v}...] 这样的数据结构的呢。。。xcv 是普通数据类型

embeds_many :myClass, class_name: 'Class' 里面可以存放你自己的类型。

You need to Sign in before reply, if you don't have an account, please Sign up first.