-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
If you explicitly declare _id: Schema.ObjectId for your model, then the ObjectId will not be available after new or save. #1285
Comments
please post code to reproduce. |
Source: http://stackoverflow.com/questions/6074245/node-mongoose-get-last-inserted-id
|
"version": "3.4.0", |
ah, the docs were incorrectly hiding the option you need (will be fixed next time they're published). you must pass the new Schema({ _id: { type: Schema.ObjectId, auto: true }}) |
aheckmann
added a commit
that referenced
this issue
Feb 12, 2013
should have been already. relates to #1285
thanks |
aheckmann
added a commit
that referenced
this issue
Mar 2, 2013
should have been already. relates to #1285
new Schema({ _id: { type: Schema.ObjectId, auto: true }}) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you explicitly declare
for your model, then the ObjectId will not be available after new or save.
The text was updated successfully, but these errors were encountered: