简体   繁体   中英

ObjectId in simpleSchema or collection2

I am just playing around with meteor and started using simple-schema and collection2. I moved from mongoose and node so my question could be a bit noob, so bear with me.

In mongoose I could just add a type called schema.ObjectId,in some field to emulate reference, but I don't see any such implication in collection2. Is there any quick solution for that?

Is using type: String a good idea for this scenario?

Thanks in advance

SimpleSchema.RegEx.Id是应用于所有典型情况的mongo id字段的类型。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM