These are chat archives for Automattic/mongoose

20th
Feb 2019
hillct
@hillct
Feb 20 19:17
Good afternoon. What’s the proper schema syntax for defining a property of type ObjectId? I have userId: { type : Schema.Types.ObjectId, required: true, ref: 'User’ } but get the error Schema is not defined. I’m importing mongoose via var mongoose = require('mongoose’); so I guess I need mongoose.Schema.Types.ObjectId
is that accurate?
David Ferguson
@jdfwarrior
Feb 20 23:56
mongoose.SchemaTypes