According to this doc here I should be allowed to do this:
var UserTag = Schema({
User: Schema.Types.ObjectId,
users_tagged: [User]
});
however doing so produces this error:
User: Schema.Types.ObjectId,
^
TypeError: Cannot read property 'ObjectId' of undefined
Does anyone know what the deal is here?
--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var Schema = require('mongoose').Schema;
I just tried 3.6.11 and the problem persists
--
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
console.log(require('util').inspect(Schema.Types.ObjectId));
```
If that doesn't throw any errors, I would suspect somewhere you have a variable named Schema that's occluding the `var Schema = require('mongoose').Schema`
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm+unsubscribe@googlegroups.com.