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
timestamp not created from Schema #14041
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Stale
Comments
popeating
added
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
help wanted
labels
Nov 2, 2023
vkarpov15
added
needs repro script
Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue
and removed
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
help wanted
labels
Nov 3, 2023
IslandRhythms
added
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
and removed
needs repro script
Maybe a bug, but no repro script. The issue reporter should create a script that demos the issue
labels
Nov 3, 2023
Please modify the script below to demonstrate your issue const mongoose = require('mongoose');
const testSchema = new mongoose.Schema({
name: String,
email: String
}, { timestamps: true });
const Test = mongoose.model('Test', testSchema);
async function run() {
await mongoose.connect('mongodb://localhost:27017');
await mongoose.connection.dropDatabase();
const doc = new Test({ name: 'Test Testerson', email: 'test@localhost.com' });
await doc.save();
console.log('what is doc', doc);
}
run(); |
@popeating how are you determining that timestamps aren't being attached? |
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This issue was closed because it has been inactive for 19 days and has been marked as stale. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Stale
Prerequisites
Mongoose version
8.0.0
Node.js version
20.9.0
MongoDB version
6.0.11
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Issue
when creating a basic schema, i enabled timestamps, but when saving new documents timestamps are not attached:
this is my schema:
and this is how i save a new document:
what am i missing?
The text was updated successfully, but these errors were encountered: