Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

>3.8.8 issue #2097

Closed
uptownhr opened this issue May 21, 2014 · 4 comments
Closed

>3.8.8 issue #2097

uptownhr opened this issue May 21, 2014 · 4 comments

Comments

@uptownhr
Copy link

After upgrading past 3.8.8, i'm seeing this error from my schema.

var logSchema = new Schema({
    'domain': {type: String, trim: true, index: true, required: true},
    "url": {type: String, trim: true, index: true, required: true },
    "type": {type: Number},
    "createdAt" : {type: Date, default: Date.now() }
},{ strict: false } );
Error: `domain` may not be used as a schema pathname
@Ppaww-Arms
Copy link

You wrote 'domain' when you don't need to use any " or ' at all.

@vkarpov15
Copy link
Collaborator

Hi,

3.8.10 added domain to list of reserved words: 2dc92cb . This is because in some versions of Node, domain is a property on an EventEmitter, see #1338, so setting domain in your schema would cause some really unfortunate problems.

Its debatable whether this was a bug or new feature, but it turns out this commit was backwards breaking and that shouldn't happen. I'll revert this commit for 3.8.11 and put it into 3.9 instead. Thanks for catching this.

@uptownhr
Copy link
Author

Good to know. Thank you!

@vkarpov15
Copy link
Collaborator

@uptownhr you should be fine with 3.8.11. However, just be aware, 3.9.0, the latest unstable release, does not support this.

I'm not sure if using domain keys will be allowed in 4.0 yet, I hope it will, as I'm gonna take some time to rethink some of mongoose's internal structure. I'll post updates on this issue as we get closer to that release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants