[英]ObjectId in simpleSchema or collection2
I am just playing around with meteor and started using simple-schema and collection2. 我正在玩meteor并开始使用simple-schema和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. 在mongoose中我可以添加一个名为schema.ObjectId的类型,在某些字段中模拟引用,但我没有在collection2中看到任何这样的含义。 Is there any quick solution for that? 那有什么快速解决方案吗?
Is using type: String a good idea for this scenario? 使用type:String这个场景是个好主意吗?
Thanks in advance 提前致谢
SimpleSchema.RegEx.Id
是应用于所有典型情况的mongo id字段的类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.